explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aUMx

Settings
# exclusive inclusive rows x rows loops node
1. 6,324.544 11,718.633 ↑ 16.7 21 1

Bitmap Heap Scan on waybills w (cost=50,440.72..137,940.22 rows=350 width=318) (actual time=6,195.769..11,718.633 rows=21 loops=1)

  • Recheck Cond: (((((desthub).hubcode = 'RON'::bpchar) AND (status >= 3) AND (status < 10) AND ((suppliercode)::text = ANY ('{SUP,T2}'::text[]))) OR (((desthub).hubcode = 'RON'::bpchar) AND (status = 10) AND ((suppliercode)::text = ANY ('{SUP,T2}'::text[])))) AND (scheduled_delivery_time > (('now'::cstring)::date - 8)))
  • Rows Removed by Index Recheck: 24326
  • 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: 6665
  • Heap Blocks: exact=288 lossy=10068
2. 30.746 5,334.113 ↓ 0.0 0 1

BitmapAnd (cost=50,440.72..50,440.72 rows=6,599 width=0) (actual time=5,334.113..5,334.113 rows=0 loops=1)

3. 0.002 1,227.585 ↓ 0.0 0 1

BitmapOr (cost=21,731.32..21,731.32 rows=306,649 width=0) (actual time=1,227.585..1,227.585 rows=0 loops=1)

4. 445.534 445.534 ↑ 2.3 49,173 1

Bitmap Index Scan on waybills_idx_hubcode_status (cost=0.00..12,604.12 rows=112,256 width=0) (actual time=445.534..445.534 rows=49,173 loops=1)

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

Bitmap Index Scan on waybills_idx_hubcode_status (cost=0.00..9,127.02 rows=194,393 width=0) (actual time=782.049..782.049 rows=302,518 loops=1)

  • Index Cond: (((desthub).hubcode = 'RON'::bpchar) AND (status = 10) AND ((suppliercode)::text = ANY ('{SUP,T2}'::text[])))
6. 4,075.782 4,075.782 ↓ 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=4,075.782..4,075.782 rows=365,847 loops=1)

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

SubPlan (forBitmap Heap Scan)

8. 0.399 30.450 ↑ 1.0 1 21

Aggregate (cost=14.05..14.06 rows=1 width=34) (actual time=1.450..1.450 rows=1 loops=21)

9. 30.051 30.051 ↑ 4.0 1 21

Index Scan using waybillparcels_idx_waybill_status on waybillparcels wp (cost=0.43..14.04 rows=4 width=34) (actual time=1.334..1.431 rows=1 loops=21)

  • Index Cond: (waybillid = w.id)
10. 0.126 29.526 ↑ 1.0 1 21

Aggregate (cost=8.58..8.59 rows=1 width=0) (actual time=1.406..1.406 rows=1 loops=21)

11. 29.400 29.400 ↑ 1.0 1 21

Index Scan using deliveries_waybill_idx on deliveries d (cost=0.56..8.58 rows=1 width=0) (actual time=1.398..1.400 rows=1 loops=21)

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