explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6lH7 : query2_13.txt

Settings
# exclusive inclusive rows x rows loops node
1. 0.023 51,935.177 ↑ 167,319.0 1 1

Sort (cost=1,131,480.46..1,131,898.75 rows=167,319 width=338) (actual time=51,935.176..51,935.177 rows=1 loops=1)

  • Sort Key: p.datetrx
  • Sort Method: quicksort Memory: 25kB
2. 51.729 51,935.154 ↑ 167,319.0 1 1

Hash Left Join (cost=625,696.02..1,090,654.16 rows=167,319 width=338) (actual time=51,901.826..51,935.154 rows=1 loops=1)

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

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

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

  • Index Cond: (c_bpartner_id = '1000034'::numeric)
6. 1,689.238 9,506.339 ↓ 1.0 7,997,639 1

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

  • Buckets: 262144 Batches: 64 Memory Usage: 8262kB
7. 7,817.101 7,817.101 ↓ 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.345..7,817.101 rows=7,997,639 loops=1)

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