explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Sw2f : query2_10MB

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

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

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

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

  • Hash Cond: (p.c_order_id = o.c_order_id)
3. 76.754 42,352.680 ↑ 167,319.0 1 1

Subquery Scan on p (cost=3,213.64..401,989.67 rows=167,319 width=322) (actual time=23,628.104..42,352.680 rows=1 loops=1)

  • Filter: ((p.availableamt <> '0'::numeric) OR (p.discountavailable <> '0'::numeric))
  • Rows Removed by Filter: 167792
4. 42,247.406 42,275.926 ↓ 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=50.938..42,275.926 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. 28.520 28.520 ↓ 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=28.520..28.520 rows=167,793 loops=1)

  • Index Cond: (c_bpartner_id = '1000034'::numeric)
6. 1,672.764 8,575.158 ↓ 1.0 7,997,639 1

Hash (cost=475,659.11..475,659.11 rows=7,997,141 width=24) (actual time=8,575.158..8,575.158 rows=7,997,639 loops=1)

  • Buckets: 262144 Batches: 64 Memory Usage: 8262kB
7. 6,902.394 6,902.394 ↓ 1.0 7,997,639 1

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

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