explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9Cvu : query2_16

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 50,834.353 ↑ 167,319.0 1 1

Sort (cost=1,131,480.46..1,131,898.75 rows=167,319 width=338) (actual time=50,834.353..50,834.353 rows=1 loops=1)

  • Sort Key: p.datetrx
  • Sort Method: quicksort Memory: 25kB
2. 60.697 50,834.343 ↑ 167,319.0 1 1

Hash Left Join (cost=625,696.02..1,090,654.16 rows=167,319 width=338) (actual time=50,809.007..50,834.343 rows=1 loops=1)

  • Hash Cond: (p.c_order_id = o.c_order_id)
3. 76.057 43,016.316 ↑ 167,319.0 1 1

Subquery Scan on p (cost=3,213.64..401,989.67 rows=167,319 width=322) (actual time=24,510.118..43,016.316 rows=1 loops=1)

  • Filter: ((p.availableamt <> '0'::numeric) OR (p.discountavailable <> '0'::numeric))
  • Rows Removed by Filter: 167792
4. 42,914.980 42,940.259 ↓ 1.0 167,793 1

Bitmap Heap Scan on c_payment (cost=3,213.64..399,479.82 rows=167,323 width=84) (actual time=44.170..42,940.259 rows=167,793 loops=1)

  • Recheck Cond: (c_bpartner_id = '1000034'::numeric)
  • Filter: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (ad_client_id = '1000000'::numeric) AND (isactive = 'Y'::bpchar))
  • Heap Blocks: exact=79732
5. 25.279 25.279 ↓ 1.0 167,793 1

Bitmap Index Scan on c_payment_bpartner (cost=0.00..3,171.81 rows=167,384 width=0) (actual time=25.279..25.279 rows=167,793 loops=1)

  • Index Cond: (c_bpartner_id = '1000034'::numeric)
6. 1,621.488 7,757.330 ↓ 1.0 7,997,643 1

Hash (cost=475,659.11..475,659.11 rows=7,997,141 width=24) (actual time=7,757.330..7,757.330 rows=7,997,643 loops=1)

  • Buckets: 262144 Batches: 32 Memory Usage: 14479kB
7. 6,135.842 6,135.842 ↓ 1.0 7,997,643 1

Seq Scan on c_order o (cost=0.00..475,659.11 rows=7,997,141 width=24) (actual time=0.013..6,135.842 rows=7,997,643 loops=1)

  • Filter: (((ordertype)::text <> 'Lay Buy Order'::text) OR (docstatus = 'VO'::bpchar) OR (ordertype IS NULL))