explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wC4h

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 9.051 ↑ 1.0 20 1

Limit (cost=1,313.02..1,313.07 rows=20 width=8) (actual time=9.022..9.051 rows=20 loops=1)

2. 0.296 9.044 ↑ 76.0 20 1

Sort (cost=1,313.02..1,316.82 rows=1,521 width=8) (actual time=9.021..9.044 rows=20 loops=1)

  • Sort Key: foo.orderid
  • Sort Method: top-N heapsort Memory: 25kB
3. 0.296 8.748 ↑ 1.2 1,263 1

Subquery Scan on foo (cost=1,238.32..1,272.55 rows=1,521 width=8) (actual time=8.011..8.748 rows=1,263 loops=1)

4. 1.452 8.452 ↑ 1.2 1,263 1

HashAggregate (cost=1,238.32..1,257.34 rows=1,521 width=20) (actual time=8.011..8.452 rows=1,263 loops=1)

  • Group Key: subordertable.orderid
  • Filter: (min(CASE WHEN ((shipmenttable.pickupdate IS NOT NULL) AND (subordertable.suborderstatusvalue = 2)) THEN 2.5 ELSE (subordertable.suborderstatusvalue)
  • Rows Removed by Filter: 469
5. 0.686 7.000 ↓ 1.3 1,993 1

Hash Left Join (cost=312.57..1,210.43 rows=1,594 width=20) (actual time=3.688..7.000 rows=1,993 loops=1)

  • Hash Cond: (subordertable.subordershipmentid = shipmenttable.shipmentid)
6. 0.956 4.659 ↓ 1.3 1,993 1

Hash Left Join (cost=167.50..1,051.98 rows=1,594 width=24) (actual time=2.018..4.659 rows=1,993 loops=1)

  • Hash Cond: (subordertable.suborderpaymentid = paymenttable.paymentid)
  • Filter: ((subordertable.subordermodeofpayment <> 'onlinepayment'::text) OR (paymenttable.paymentgatewaystatus = 'success'::text))
  • Rows Removed by Filter: 282
7. 1.778 2.040 ↓ 1.1 2,275 1

Bitmap Heap Scan on subordertable (cost=48.79..911.21 rows=2,027 width=40) (actual time=0.334..2.040 rows=2,275 loops=1)

  • Recheck Cond: ((storeid = 2251) OR (parentstoreid = 2251))
  • Heap Blocks: exact=595
8. 0.236 0.262 ↓ 0.0 0 1

BitmapOr (cost=48.79..48.79 rows=2,028 width=0) (actual time=0.262..0.262 rows=0 loops=1)

  • -> Bitmap Index Scan on idx_parentstoreid_subordertable (cost=0.00..43.46 rows=2023 width=0) (actual time=0.235..0.235 rows=2288 lo
9. 0.026 0.026 ↓ 5.2 26 1

Bitmap Index Scan on idx_storeid_subordertable (cost=0.00..4.32 rows=5 width=0) (actual time=0.026..0.026 rows=26 loops=1)

  • Index Cond: (storeid = 2251)
  • Index Cond: (parentstoreid = 2251)
10. 0.851 1.663 ↓ 1.0 3,511 1

Hash (cost=74.98..74.98 rows=3,498 width=16) (actual time=1.663..1.663 rows=3,511 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 165kB
11. 0.812 0.812 ↓ 1.0 3,511 1

Seq Scan on paymenttable (cost=0.00..74.98 rows=3,498 width=16) (actual time=0.004..0.812 rows=3,511 loops=1)

12. 0.749 1.655 ↑ 1.0 3,203 1

Hash (cost=103.92..103.92 rows=3,292 width=12) (actual time=1.655..1.655 rows=3,203 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 147kB
13. 0.906 0.906 ↑ 1.0 3,203 1

Seq Scan on shipmenttable (cost=0.00..103.92 rows=3,292 width=12) (actual time=0.010..0.906 rows=3,203 loops=1)