explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1Vah

Settings
# exclusive inclusive rows x rows loops node
1. 2,677.597 38,535.400 ↑ 1.0 1 1

Aggregate (cost=11,733,466.50..11,733,466.51 rows=1 width=48) (actual time=38,535.400..38,535.400 rows=1 loops=1)

2. 1,861.950 35,857.803 ↑ 6.0 5,025,780 1

Hash Join (cost=6,391,144.29..10,521,612.58 rows=30,296,348 width=34) (actual time=16,023.641..35,857.803 rows=5,025,780 loops=1)

  • Hash Cond: (og_q.og_question_object_id = og_o.id)
3. 2,815.819 32,677.087 ↑ 4.3 7,033,328 1

Merge Join (cost=6,157,315.69..10,119,696.47 rows=30,296,348 width=16) (actual time=7,787.582..32,677.087 rows=7,033,328 loops=1)

  • Merge Cond: (og_q.document_id = dn.document_id)
4. 20,573.859 20,573.859 ↑ 1.4 30,530,546 1

Index Scan using fk_idx_bhpx on og_question og_q (cost=0.56..3,415,437.07 rows=42,995,336 width=16) (actual time=0.014..20,573.859 rows=30,530,546 loops=1)

5. 3,070.471 9,287.409 ↓ 1.0 7,038,355 1

Sort (cost=6,148,366.64..6,165,311.59 rows=6,777,977 width=16) (actual time=7,769.886..9,287.409 rows=7,038,355 loops=1)

  • Sort Key: dn.document_id
  • Sort Method: quicksort Memory: 466,759kB
6. 4,109.190 6,216.938 ↑ 1.1 6,229,240 1

Bitmap Heap Scan on document_n dn (cost=1,140,663.08..5,379,323.03 rows=6,777,977 width=16) (actual time=2,485.894..6,216.938 rows=6,229,240 loops=1)

  • Recheck Cond: ((category = 2) AND ((cdate)::date >= '2018-07-02'::date))
  • Heap Blocks: exact=1,297,662
7. 2,107.748 2,107.748 ↑ 1.0 6,587,403 1

Bitmap Index Scan on dn_c_nt_cdate (cost=0.00..1,138,968.59 rows=6,777,977 width=0) (actual time=2,107.748..2,107.748 rows=6,587,403 loops=1)

  • Index Cond: ((category = 2) AND ((cdate)::date >= '2018-07-02'::date))
8. 155.339 1,318.766 ↑ 1.0 919,665 1

Hash (cost=222,223.70..222,223.70 rows=928,392 width=26) (actual time=1,318.766..1,318.766 rows=919,665 loops=1)

  • Buckets: 1,048,576 Batches: 1 Memory Usage: 51,851kB
9. 253.770 1,163.427 ↑ 1.0 919,665 1

Hash Left Join (cost=110,882.46..222,223.70 rows=928,392 width=26) (actual time=508.296..1,163.427 rows=919,665 loops=1)

  • Hash Cond: (og_o.id = og_o_1.id)
10. 401.857 401.857 ↑ 1.0 919,665 1

Seq Scan on og_question_object og_o (cost=0.00..105,052.92 rows=928,392 width=10) (actual time=0.005..401.857 rows=919,665 loops=1)

11. 40.729 507.800 ↑ 1.0 276,387 1

Hash (cost=107,373.90..107,373.90 rows=280,685 width=16) (actual time=507.800..507.800 rows=276,387 loops=1)

  • Buckets: 524,288 Batches: 1 Memory Usage: 17,052kB
12. 467.071 467.071 ↑ 1.0 276,387 1

Seq Scan on og_question_object og_o_1 (cost=0.00..107,373.90 rows=280,685 width=16) (actual time=0.003..467.071 rows=276,387 loops=1)

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