explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oW2t

Settings
# exclusive inclusive rows x rows loops node
1. 1,663.934 45,319.882 ↑ 1.0 1 1

Aggregate (cost=2,975,366.57..2,975,366.58 rows=1 width=48) (actual time=45,319.882..45,319.882 rows=1 loops=1)

2. 473.625 43,655.948 ↑ 5.4 1,622,808 1

Merge Join (cost=349,017.16..2,536,715.32 rows=8,773,025 width=34) (actual time=27,486.358..43,655.948 rows=1,622,808 loops=1)

  • Merge Cond: (og_q.og_question_object_id = og_o.id)
3. 682.115 42,120.097 ↑ 5.4 1,622,808 1

Merge Join (cost=138,398.81..12,153,725.15 rows=8,773,025 width=32) (actual time=26,547.530..42,120.097 rows=1,622,808 loops=1)

  • Merge Cond: (og_q.og_question_object_id = og_o_1.id)
4. 0.000 40,850.841 ↑ 6.7 4,390,984 1

Nested Loop (cost=1.00..66,629,329.19 rows=29,295,479 width=16) (actual time=0.039..40,850.841 rows=4,390,984 loops=1)

5. 7,915.988 7,915.988 ↑ 7.7 5,571,695 1

Index Scan using og_question_og_question_object_id_idx on og_question og_q (cost=0.43..7,428,387.55 rows=42,995,336 width=16) (actual time=0.015..7,915.988 rows=5,571,695 loops=1)

6. 33,430.170 33,430.170 ↑ 2.0 1 5,571,695

Index Scan using doc_n_did_c_n_nbl_del_oid_idx on document_n dn (cost=0.57..1.36 rows=2 width=16) (actual time=0.005..0.006 rows=1 loops=5,571,695)

  • Index Cond: ((document_id = og_q.document_id) AND (category = 2) AND (d_deleted = 0))
  • Filter: ((rdate)::date >= '2018-07-02'::date)
  • Rows Removed by Filter: 0
7. 228.825 587.141 ↓ 5.3 1,662,102 1

Sort (cost=137,298.07..138,078.67 rows=312,243 width=16) (actual time=415.258..587.141 rows=1,662,102 loops=1)

  • Sort Key: og_o_1.id
  • Sort Method: quicksort Memory: 25,237kB
8. 358.316 358.316 ↑ 1.1 276,228 1

Seq Scan on og_question_object og_o_1 (cost=0.00..108,802.29 rows=312,243 width=16) (actual time=0.005..358.316 rows=276,228 loops=1)

  • Filter: (cdate >= '2018-07-02 00:00:00'::timestamp without time zone)
  • Rows Removed by Filter: 643,278
9. 525.148 1,062.226 ↓ 2.2 2,305,380 1

Sort (cost=210,419.40..213,026.05 rows=1,042,663 width=10) (actual time=824.781..1,062.226 rows=2,305,380 loops=1)

  • Sort Key: og_o.id
  • Sort Method: quicksort Memory: 67,678kB
10. 537.078 537.078 ↑ 1.1 919,506 1

Seq Scan on og_question_object og_o (cost=0.00..106,195.63 rows=1,042,663 width=10) (actual time=0.017..537.078 rows=919,506 loops=1)

Planning time : 1.873 ms
Execution time : 45,321.892 ms