explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iihO : huge plan

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 853.374 ↑ 1.0 1 1

Limit (cost=32,679.45..32,679.46 rows=1 width=1,301) (actual time=853.370..853.374 rows=1 loops=1)

2. 190.118 853.369 ↑ 179,998.0 1 1

Sort (cost=32,679.45..33,129.45 rows=179,998 width=1,301) (actual time=853.369..853.369 rows=1 loops=1)

  • Sort Key: d.updated_on, d.id, "d.Task.SaleTaxCommitmentRequest".task_id
  • Sort Method: top-N heapsort Memory: 25kB
3. 90.931 663.251 ↓ 1.0 180,000 1

Hash Left Join (cost=1,117.15..31,779.46 rows=179,998 width=1,301) (actual time=12.913..663.251 rows=180,000 loops=1)

  • Hash Cond: ("d.Task".id = "d.Task.RefundTaxCommitmentRequest".task_id)
4. 129.728 559.468 ↓ 1.0 180,000 1

Merge Left Join (cost=2.09..29,969.63 rows=179,998 width=430) (actual time=0.045..559.468 rows=180,000 loops=1)

  • Merge Cond: ("d.Task".id = "d.Task.SaleTaxCommitmentRequest".task_id)
5. 136.556 382.232 ↓ 1.0 180,000 1

Merge Join (cost=1.29..19,481.74 rows=179,998 width=311) (actual time=0.035..382.232 rows=180,000 loops=1)

  • Merge Cond: (d.task_id = "d.Task".id)
6. 144.300 144.300 ↓ 1.0 180,000 1

Index Scan using "IX_task_commitment_document_task_id" on task_commitment_document d (cost=0.42..10,010.48 rows=179,998 width=110) (actual time=0.013..144.300 rows=180,000 loops=1)

  • Filter: (((updated_on > '2019-07-03 00:00:00'::timestamp without time zone) OR ((updated_on = '2019-07-03 00:00:00'::timestamp without time zone) AND (id > 1602))) AND (updated_on < timezone('UTC'::text, now())))
7. 101.376 101.376 ↓ 1.0 182,000 1

Index Scan using pk_document_task on document_task "d.Task" (cost=0.42..6,937.10 rows=181,980 width=201) (actual time=0.018..101.376 rows=182,000 loops=1)

  • Filter: ((company_id)::text = '10000'::text)
8. 47.508 47.508 ↑ 1.0 180,000 1

Index Scan using pk_sale_tax_commitment_request on sale_tax_commitment_request "d.Task.SaleTaxCommitmentRequest" (cost=0.42..8,110.51 rows=180,137 width=119) (actual time=0.008..47.508 rows=180,000 loops=1)

9. 1.004 12.852 ↑ 1.0 2,000 1

Hash (cost=1,090.06..1,090.06 rows=2,000 width=871) (actual time=12.852..12.852 rows=2,000 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 251kB
10. 2.670 11.848 ↑ 1.0 2,000 1

Merge Left Join (cost=802.09..1,090.06 rows=2,000 width=871) (actual time=8.212..11.848 rows=2,000 loops=1)

  • Merge Cond: ("d.Task.RefundTaxCommitmentRequest".task_id_to_refund = "d.Task.RefundTaxCommitmentRequest.TaskToRefund".id)
11. 0.753 0.753 ↑ 1.0 2,000 1

Index Scan using "IX_refund_tax_commitment_request_task_id_to_refund" on refund_tax_commitment_request "d.Task.RefundTaxCommitmentRequest" (cost=0.28..95.54 rows=2,000 width=670) (actual time=0.009..0.753 rows=2,000 loops=1)

12. 8.425 8.425 ↑ 7.6 23,999 1

Index Scan using pk_document_task on document_task "d.Task.RefundTaxCommitmentRequest.TaskToRefund" (cost=0.42..6,482.15 rows=181,980 width=201) (actual time=0.018..8.425 rows=23,999 loops=1)

Planning time : 1.407 ms
Execution time : 853.579 ms