{% extends "django_pev/base.html" %} {% block content %} {% load humanize %}

Explain Query

This page helps find the slowest queries of a page and explains it using an embedded version of Postgres Explain Visualizer 2 (by dalibo)
{% csrf_token %}
The url should not include the protocol or the base url. For example (/dashboard/) .
{% if explain and explain.queries %}
Slowest Query {{ slowest.duration|floatformat:4 }}s
{% csrf_token %}
{{ slowest.sql }}
All Queries {{explain.queries | length}}
    {% for query in explain.queries %}
  1. {{ query.duration | floatformat:4}}s {{ query.sql | truncatechars:100 }}

    {% csrf_token %}

    {{ query.sql }}
                                                    
    {{ query.stack_trace}}
                                                    
  2. {% endfor %}
{% elif explain %}
No queries executed (probably a redirect.)
{% endif %}
{% endblock %}