explain.depesz.com

PostgreSQL's explain analyze made readable

Result: k8OV

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 24,285.784 ↑ 1.0 26 1

Limit (cost=792,982.97..792,983.03 rows=26 width=53) (actual time=24,285.777..24,285.784 rows=26 loops=1)

2. 146.752 24,285.779 ↑ 23,546.7 26 1

Sort (cost=792,982.97..794,513.50 rows=612,213 width=53) (actual time=24,285.775..24,285.779 rows=26 loops=1)

  • Sort Key: (min(access_to_doc.date_created)) DESC NULLS LAST, (max(documents.seqnum))
  • Sort Method: top-N heapsort Memory: 28kB
3. 696.608 24,139.027 ↓ 1.3 825,659 1

HashAggregate (cost=769,411.42..775,533.55 rows=612,213 width=53) (actual time=23,835.872..24,139.027 rows=825,659 loops=1)

  • Group Key: access_to_doc.document_id
4. 1,343.603 23,442.419 ↑ 1.1 830,925 1

Hash Right Join (cost=605,129.22..762,638.84 rows=903,011 width=53) (actual time=21,212.205..23,442.419 rows=830,925 loops=1)

  • Hash Cond: ((document_recipients.document_id)::text = (documents.id)::text)
5. 887.927 887.927 ↓ 1.0 4,003,676 1

Seq Scan on document_recipients (cost=0.00..133,562.55 rows=3,977,855 width=37) (actual time=0.197..887.927 rows=4,003,676 loops=1)

6. 267.379 21,210.889 ↑ 1.0 828,439 1

Hash (cost=594,751.91..594,751.91 rows=830,185 width=90) (actual time=21,210.889..21,210.889 rows=828,439 loops=1)

  • Buckets: 1048576 Batches: 1 Memory Usage: 109320kB
7. 1,238.694 20,943.510 ↑ 1.0 828,439 1

Hash Join (cost=376,462.82..594,751.91 rows=830,185 width=90) (actual time=6,936.160..20,943.510 rows=828,439 loops=1)

  • Hash Cond: ((access_to_doc.document_id)::text = (documents.id)::text)
8. 12,786.083 13,699.451 ↑ 1.0 828,439 1

Bitmap Heap Scan on access_to_doc (cost=12,542.40..169,783.05 rows=847,012 width=45) (actual time=927.656..13,699.451 rows=828,439 loops=1)

  • Recheck Cond: ((access_edrpou)::text = '31316718'::text)
  • Heap Blocks: exact=56750
9. 913.368 913.368 ↑ 1.0 841,380 1

Bitmap Index Scan on ix_access_to_doc_access_edrpou (cost=0.00..12,330.65 rows=847,012 width=0) (actual time=913.368..913.368 rows=841,380 loops=1)

  • Index Cond: ((access_edrpou)::text = '31316718'::text)
10. 965.977 6,005.365 ↓ 1.0 3,610,019 1

Hash (cost=287,611.48..287,611.48 rows=3,584,395 width=45) (actual time=6,005.365..6,005.365 rows=3,610,019 loops=1)

  • Buckets: 2097152 Batches: 4 Memory Usage: 84145kB
11. 5,039.388 5,039.388 ↓ 1.0 3,610,019 1

Seq Scan on documents (cost=0.00..287,611.48 rows=3,584,395 width=45) (actual time=0.174..5,039.388 rows=3,610,019 loops=1)

  • Filter: (is_internal IS FALSE)
  • Rows Removed by Filter: 70087
Planning time : 1.035 ms
Execution time : 24,287.791 ms