explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lErS

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 2,402.092 58,522.873 ↑ 1.0 1 1

Aggregate (cost=11,784,612.74..11,784,612.75 rows=1 width=48) (actual time=58,522.873..58,522.873 rows=1 loops=1)

2. 1,443.907 56,120.781 ↑ 6.7 4,391,226 1

Hash Join (cost=6,502,426.70..10,612,762.86 rows=29,296,247 width=34) (actual time=37,703.116..56,120.781 rows=4,391,226 loops=1)

  • Hash Cond: (og_q.og_question_object_id = og_o.id)
3. 2,499.651 53,514.812 ↑ 4.8 6,044,522 1

Merge Join (cost=6,263,466.77..10,211,264.09 rows=29,296,247 width=16) (actual time=29,818.394..53,514.812 rows=6,044,522 loops=1)

  • Merge Cond: (og_q.document_id = dn.document_id)
4. 19,876.450 19,876.450 ↑ 1.4 30,524,875 1

Index Scan using fk_idx_bhpx on og_question og_q (cost=0.56..3,415,357.07 rows=42,995,336 width=16) (actual time=0.015..19,876.450 rows=30,524,875 loops=1)

5. 2,616.914 31,138.711 ↑ 1.1 6,044,633 1

Sort (cost=6,254,813.12..6,271,198.70 rows=6,554,232 width=16) (actual time=29,813.029..31,138.711 rows=6,044,633 loops=1)

  • Sort Key: dn.document_id
  • Sort Method: quicksort Memory: 422,329kB
6. 18,896.843 28,521.797 ↑ 1.2 5,281,408 1

Bitmap Heap Scan on document_n dn (cost=962,676.13..5,512,743.13 rows=6,554,232 width=16) (actual time=11,029.381..28,521.797 rows=5,281,408 loops=1)

  • Recheck Cond: (category = 2)
  • Filter: ((d_deleted = 0) AND ((rdate)::date >= '2018-07-02'::date))
  • Rows Removed by Filter: 22,778,693
  • Heap Blocks: exact=3,888,694
7. 9,624.954 9,624.954 ↓ 1.0 28,418,998 1

Bitmap Index Scan on dn_ctg_orgid_n_docid_idx (cost=0.00..961,037.57 rows=28,146,800 width=0) (actual time=9,624.954..9,624.954 rows=28,418,998 loops=1)

  • Index Cond: (category = 2)
8. 173.523 1,162.062 ↑ 1.1 919,513 1

Hash (cost=225,928.50..225,928.50 rows=1,042,515 width=26) (actual time=1,162.062..1,162.062 rows=919,513 loops=1)

  • Buckets: 1,048,576 Batches: 1 Memory Usage: 51,842kB
9. 204.769 988.539 ↑ 1.1 919,513 1

Hash Left Join (cost=112,702.93..225,928.50 rows=1,042,515 width=26) (actual time=412.078..988.539 rows=919,513 loops=1)

  • Hash Cond: (og_o.id = og_o_1.id)
10. 373.883 373.883 ↑ 1.1 919,513 1

Seq Scan on og_question_object og_o (cost=0.00..106,194.15 rows=1,042,515 width=10) (actual time=0.009..373.883 rows=919,513 loops=1)

11. 47.357 409.887 ↑ 1.1 276,235 1

Hash (cost=108,800.44..108,800.44 rows=312,199 width=16) (actual time=409.887..409.887 rows=276,235 loops=1)

  • Buckets: 524,288 Batches: 1 Memory Usage: 17,045kB
12. 362.530 362.530 ↑ 1.1 276,235 1

Seq Scan on og_question_object og_o_1 (cost=0.00..108,800.44 rows=312,199 width=16) (actual time=0.006..362.530 rows=276,235 loops=1)

  • Filter: (cdate >= '2018-07-02 00:00:00'::timestamp without time zone)
  • Rows Removed by Filter: 643,278
Planning time : 2.187 ms
Execution time : 58,539.337 ms