explain.depesz.com

PostgreSQL's explain analyze made readable

Result: z8zf

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 2,323.086 ↑ 1.0 1 1

Aggregate (cost=1,500.89..1,500.90 rows=1 width=8) (actual time=2,323.086..2,323.086 rows=1 loops=1)

2. 0.045 2,323.076 ↓ 3.3 10 1

Unique (cost=1,500.77..1,500.85 rows=3 width=785) (actual time=2,323.032..2,323.076 rows=10 loops=1)

3. 0.181 2,323.031 ↓ 3.7 11 1

Sort (cost=1,500.77..1,500.77 rows=3 width=785) (actual time=2,323.030..2,323.031 rows=11 loops=1)

  • Sort Key: documents_document.id, documents_document.correspondent_id, documents_document.title, documents_document.content, doc
  • Sort Method: quicksort Memory: 36kB
4. 2,288.347 2,322.850 ↓ 3.7 11 1

Hash Left Join (cost=1,319.88..1,500.74 rows=3 width=785) (actual time=86.258..2,322.850 rows=11 loops=1)

  • Hash Cond: (documents_document.correspondent_id = documents_correspondent.id)
  • Filter: ((upper(documents_correspondent.name) ~~ '%MOTOROLA%'::text) OR (upper(documents_document.title) ~~ '%MOTOROLA%':
  • Rows Removed by Filter: 8505
5. 6.858 34.264 ↓ 1.1 8,516 1

Hash Left Join (cost=1,303.99..1,464.08 rows=7,722 width=799) (actual time=11.770..34.264 rows=8,516 loops=1)

  • Hash Cond: (documents_document_tags.tag_id = documents_tag.id)
6. 15.764 27.213 ↓ 1.1 8,516 1

Hash Right Join (cost=1,294.74..1,434.25 rows=7,722 width=789) (actual time=11.524..27.213 rows=8,516 loops=1)

  • Hash Cond: (documents_document_tags.document_id = documents_document.id)
  • -> Seq Scan on documents_document_tags (cost=0.00..119.22 rows=7722 width=8) (actual time=0.017..2.760 rows
7. 11.449 11.449 ↓ 1.1 4,876 1

Hash (cost=1,237.66..1,237.66 rows=4,566 width=785) (actual time=11.449..11.449 rows=4,876 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 3996kB
  • -> Seq Scan on documents_document (cost=0.00..1237.66 rows=4566 width=785) (actual time=0.022..4.380
8. 0.193 0.193 ↓ 1.0 288 1

Hash (cost=5.78..5.78 rows=278 width=18) (actual time=0.193..0.193 rows=288 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 23kB
  • -> Seq Scan on documents_tag (cost=0.00..5.78 rows=278 width=18) (actual time=0.011..0.101 rows=288 loops=1
9. 0.239 0.239 ↑ 1.2 420 1

Hash (cost=9.84..9.84 rows=484 width=22) (actual time=0.239..0.239 rows=420 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 31kB
  • -> Seq Scan on documents_correspondent (cost=0.00..9.84 rows=484 width=22) (actual time=0.010..0.116 rows=420 loo