A helper to get EXPLAIN and EXPLAIN ANALYZE OUTPUT for django queryset.
Project description
# Django-Explain - a helper to get EXPLAIN or EXPLAIN ANALYZE output for django queryset.
## Installation
```sh
pip install django-queryset
```
## Example
```py
from django.contrib.auth.models import User
from django_explain import explain
explain_result = explain(User.objects.filter(pk=123))
explain_result.pretty_print()
# SELECT "auth_user"."id",
# "auth_user"."password",
# "auth_user"."last_login",
# "auth_user"."is_superuser",
# "auth_user"."username",
# "auth_user"."first_name",
# "auth_user"."last_name",
# "auth_user"."email",
# "auth_user"."is_staff",
# "auth_user"."is_active",
# "auth_user"."date_joined",
# "auth_user"."has_orders"
# FROM "auth_user"
# WHERE "auth_user"."id" = 1
#
# Index Scan using auth_user_pkey on auth_user (cost=0.43..8.45 rows=1 width=1070) (actual time=0.039..0.039 rows=0 loops=1)
# Index Cond: (id = 1)
# Planning time: 1.203 ms
# Execution time: 0.106 ms
result.get_depesz_url()
# https://explain.depesz.com/s/Tym
```
## Installation
```sh
pip install django-queryset
```
## Example
```py
from django.contrib.auth.models import User
from django_explain import explain
explain_result = explain(User.objects.filter(pk=123))
explain_result.pretty_print()
# SELECT "auth_user"."id",
# "auth_user"."password",
# "auth_user"."last_login",
# "auth_user"."is_superuser",
# "auth_user"."username",
# "auth_user"."first_name",
# "auth_user"."last_name",
# "auth_user"."email",
# "auth_user"."is_staff",
# "auth_user"."is_active",
# "auth_user"."date_joined",
# "auth_user"."has_orders"
# FROM "auth_user"
# WHERE "auth_user"."id" = 1
#
# Index Scan using auth_user_pkey on auth_user (cost=0.43..8.45 rows=1 width=1070) (actual time=0.039..0.039 rows=0 loops=1)
# Index Cond: (id = 1)
# Planning time: 1.203 ms
# Execution time: 0.106 ms
result.get_depesz_url()
# https://explain.depesz.com/s/Tym
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-explain-1.1.1.tar.gz
(3.0 kB
view details)
File details
Details for the file django-explain-1.1.1.tar.gz.
File metadata
- Download URL: django-explain-1.1.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
915f472a389bcf575e99df5d36d9731b12bf40076452ac9a1a56eb14800c30d4
|
|
| MD5 |
64e275aa3bf414366c51f44b5fb4d707
|
|
| BLAKE2b-256 |
670ed7b919ff0a88b56cd6f600db59f2bc048da30fd788ff0d25dee5ed8f0144
|