explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mvA6

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 38,390.867 ↑ 1.0 1 1

Limit (cost=52,593,063,661.32..52,593,063,661.32 rows=1 width=14) (actual time=38,390.866..38,390.867 rows=1 loops=1)

2. 0.009 38,390.865 ↑ 5,155,480.0 1 1

Sort (cost=52,593,063,661.32..52,593,076,550.02 rows=5,155,480 width=14) (actual time=38,390.865..38,390.865 rows=1 loops=1)

  • Sort Key: inl.created
  • Sort Method: quicksort Memory: 25kB
3. 38,390.856 38,390.856 ↑ 2,577,740.0 2 1

Seq Scan on c_invoiceline inl (cost=0.00..52,593,037,883.92 rows=5,155,480 width=14) (actual time=16,600.802..38,390.856 rows=2 loops=1)

  • Filter: (SubPlan 1)
  • Rows Removed by Filter: 10310958
4.          

SubPlan (for Seq Scan)

5. 0.000 0.000 ↓ 0.0 0 10,310,960

Result (cost=0.43..10,194.64 rows=2,490 width=6) (actual time=0.000..0.000 rows=0 loops=10,310,960)

  • One-Time Filter: (inl.m_product_id = 1001646::numeric)
6. 3,303.057 3,303.057 ↓ 3.4 8,531 139

Index Scan using c_doctypetarget_id_c_invoice_idx on c_invoice (cost=0.43..10,194.64 rows=2,490 width=6) (actual time=1.569..23.763 rows=8,531 loops=139)

  • Index Cond: (c_doctypetarget_id = ANY ('{1000143,1000204,1000327,1000342}'::numeric[]))
  • Filter: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (ad_org_id = 1000004::numeric))
  • Rows Removed by Filter: 24517
Planning time : 17.939 ms
Execution time : 38,390.931 ms