explain.depesz.com

PostgreSQL's explain analyze made readable

Result: O6AR

Settings
# exclusive inclusive rows x rows loops node
1. 62.648 329.758 ↑ 44.0 10 1

Bitmap Heap Scan on waybills w (cost=56,000.62..163,473.44 rows=440 width=314) (actual time=292.161..329.758 rows=10 loops=1)

  • Recheck Cond: (((((desthub).hubcode = 'SAN'::bpchar) AND (status >= 3) AND (status < 10) AND ((suppliercode)::text = ANY ('{SUP,T2}'::text[]))) OR (((desthub).hubcode = 'SAN'::bpchar) AND (status = 10) AND ((suppliercode)::text = ANY ('{SUP,T2}'::text[])))) AND (scheduled_delivery_time > (('now'::cstring)::date - 8)))
  • Rows Removed by Index Recheck: 29714
  • Filter: ((shipping_options).collect AND ((suppliercode)::text = ANY ('{SUP,T2}'::text[])) AND (status <> 8) AND (waybilltype = 'EXP'::bpchar) AND (((status >= 3) AND (status < 10)) OR ((status = 10) AND ((driverdeliveredtime)::date = ('now'::cstring)::date))) AND ((SubPlan 2) >= 1))
  • Rows Removed by Filter: 8416
  • Heap Blocks: exact=322 lossy=12257
2. 29.892 267.000 ↓ 0.0 0 1

BitmapAnd (cost=56,000.62..56,000.62 rows=8,297 width=0) (actual time=267.000..267.000 rows=0 loops=1)

3. 0.003 149.514 ↓ 0.0 0 1

BitmapOr (cost=27,291.19..27,291.19 rows=385,593 width=0) (actual time=149.514..149.514 rows=0 loops=1)

4. 53.737 53.737 ↑ 1.3 112,201 1

Bitmap Index Scan on waybills_idx_hubcode_status (cost=0.00..15,830.37 rows=141,156 width=0) (actual time=53.737..53.737 rows=112,201 loops=1)

  • Index Cond: (((desthub).hubcode = 'SAN'::bpchar) AND (status >= 3) AND (status < 10) AND ((suppliercode)::text = ANY ('{SUP,T2}'::text[])))
5. 95.774 95.774 ↓ 1.2 302,642 1

Bitmap Index Scan on waybills_idx_hubcode_status (cost=0.00..11,460.60 rows=244,437 width=0) (actual time=95.774..95.774 rows=302,642 loops=1)

  • Index Cond: (((desthub).hubcode = 'SAN'::bpchar) AND (status = 10) AND ((suppliercode)::text = ANY ('{SUP,T2}'::text[])))
6. 87.594 87.594 ↓ 1.1 365,847 1

Bitmap Index Scan on waybills_idx_schedules_delivery_date (cost=0.00..28,709.07 rows=347,267 width=0) (actual time=87.594..87.594 rows=365,847 loops=1)

  • Index Cond: (scheduled_delivery_time > (('now'::cstring)::date - 8))
7.          

SubPlan (forBitmap Heap Scan)

8. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.56..8.58 rows=1 width=12) (never executed)

9. 0.000 0.000 ↓ 0.0 0

Index Scan using deliveries_waybill_idx on deliveries d (cost=0.56..8.58 rows=1 width=12) (never executed)

  • Index Cond: (waybillid = w.id)
  • Filter: (cancelledtime IS NULL)
10. 0.030 0.110 ↑ 1.0 1 10

Aggregate (cost=8.58..8.59 rows=1 width=0) (actual time=0.010..0.011 rows=1 loops=10)

11. 0.080 0.080 ↑ 1.0 1 10

Index Scan using deliveries_waybill_idx on deliveries d_1 (cost=0.56..8.58 rows=1 width=0) (actual time=0.007..0.008 rows=1 loops=10)

  • Index Cond: (waybillid = w.id)
  • Filter: (cancelledtime IS NULL)