explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PnQy

Settings
# exclusive inclusive rows x rows loops node
1. 0.042 2,087.709 ↓ 3.3 10 1

Unique (cost=953.18..953.26 rows=3 width=888) (actual time=2,087.668..2,087.709 rows=10 loops=1)

2. 0.122 2,087.667 ↓ 3.7 11 1

Sort (cost=953.18..953.19 rows=3 width=888) (actual time=2,087.666..2,087.667 rows=11 loops=1)

  • Sort Key: documents_document.id, documents_document.correspondent_id, documents_document.title, documents_document.content, documents_document.file_type, docu
  • Sort Method: quicksort Memory: 36kB
3. 2,064.121 2,087.545 ↓ 3.7 11 1

Hash Left Join (cost=217.19..953.16 rows=3 width=888) (actual time=103.760..2,087.545 rows=11 loops=1)

  • Hash Cond: (documents_document_tags.tag_id = documents_tag.id)
  • Filter: ((upper(documents_correspondent.name) ~~ '%MOTOROLA%'::text) OR (upper(documents_document.title) ~~ '%MOTOROLA%'::text) OR (upper(documents_docu
  • Rows Removed by Filter: 8028
4. 7.280 23.274 ↓ 1.2 8,039 1

Hash Left Join (cost=207.94..924.78 rows=6,987 width=910) (actual time=3.477..23.274 rows=8,039 loops=1)

  • Hash Cond: (documents_document.id = documents_document_tags.document_id)
5. 5.117 12.764 ↑ 1.0 4,546 1

Hash Left Join (cost=12.73..614.25 rows=4,546 width=906) (actual time=0.229..12.764 rows=4,546 loops=1)

  • Hash Cond: (documents_document.correspondent_id = documents_correspondent.id)
6. 7.441 7.441 ↑ 1.0 4,546 1

Seq Scan on documents_document (cost=0.00..589.46 rows=4,546 width=888) (actual time=0.013..7.441 rows=4,546 loops=1)

7. 0.103 0.206 ↑ 1.0 387 1

Hash (cost=7.88..7.88 rows=388 width=22) (actual time=0.206..0.206 rows=387 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 29kB
8. 0.103 0.103 ↑ 1.0 387 1

Seq Scan on documents_correspondent (cost=0.00..7.88 rows=388 width=22) (actual time=0.008..0.103 rows=387 loops=1)

9. 1.503 3.230 ↑ 1.0 6,987 1

Hash (cost=107.87..107.87 rows=6,987 width=8) (actual time=3.230..3.230 rows=6,987 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 337kB
10. 1.727 1.727 ↑ 1.0 6,987 1

Seq Scan on documents_document_tags (cost=0.00..107.87 rows=6,987 width=8) (actual time=0.010..1.727 rows=6,987 loops=1)

11. 0.072 0.150 ↑ 1.0 278 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 22kB
12. 0.078 0.078 ↑ 1.0 278 1

Seq Scan on documents_tag (cost=0.00..5.78 rows=278 width=18) (actual time=0.012..0.078 rows=278 loops=1)