explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WNDP

Settings
# exclusive inclusive rows x rows loops node
1. 82.780 258.752 ↓ 5.0 5 1

Nested Loop (cost=8.59..26.41 rows=1 width=1,685) (actual time=0.513..258.752 rows=5 loops=1)

2. 40.266 40.729 ↓ 5,009.0 5,009 1

Bitmap Heap Scan on promotion_pricerule (cost=4.29..11.66 rows=1 width=1,685) (actual time=0.441..40.729 rows=5,009 loops=1)

  • Recheck Cond: (((market_code)::text = 'SE'::text) AND is_active)
  • Filter: (((date_range IS NULL) OR (date_range @> '2020-03-24 16:25:47.845507+00'::timestamp with time zone)) AND (type = ANY ('{1,2}'::integer[])))
  • Rows Removed by Filter: 3
  • Heap Blocks: exact=165
3. 0.463 0.463 ↓ 2,547.0 5,094 1

Bitmap Index Scan on rule_market_code_type_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.397..0.463 rows=5,094 loops=1)

  • Index Cond: ((market_code)::text = 'SE'::text)
4. 85.153 135.243 ↓ 0.0 0 5,009

Bitmap Heap Scan on promotion_criterion (cost=4.30..14.74 rows=1 width=4) (actual time=0.027..0.027 rows=0 loops=5,009)

  • Recheck Cond: (price_rule_id = promotion_pricerule.id)
  • Filter: ((((key)::text = 'store'::text) AND (operator = 1) AND (value = '"10010"'::jsonb)) OR (((key)::text = 'store'::text) AND (operator = 7) AND (value @> '["10010"]'::jsonb)) OR (((key)::text = 'store'::text) AND (operator = 2) AND (value <> '"10010"'::jsonb)) OR (((key)::text = 'cart_total'::text) AND (operator = 1) AND (value = '123.0'::jsonb)) OR (((key)::text = 'cart_total'::text) AND (operator = 7) AND (value @> '[123.0]'::jsonb)) OR (((key)::text = 'cart_total'::text) AND (operator = 2) AND (value <> '123.0'::jsonb)) OR (((key)::text = 'cart_total'::text) AND (operator = 3) AND (value < '123.0'::jsonb)) OR (((key)::text = 'cart_total'::text) AND (operator = 4) AND (value <= '123.0'::jsonb)) OR (((key)::text = 'cart_total'::text) AND (operator = 5) AND (value > '123.0'::jsonb)) OR (((key)::text = 'cart_total'::text) AND (operator = 6) AND (value >= '123.0'::jsonb)) OR (((key)::text = 'sku'::text) AND (operator = 1) AND (value = ANY ('{"\"AAA\"","\"BBB\""}'::jsonb[]))) OR (((key)::text = 'sku'::text) AND (operator = 7) AND (value @> '["AAA", "BBB"]'::jsonb)) OR (((key)::text = 'sku'::text) AND (operator = 2) AND (value <> ALL ('{"\"AAA\"","\"BBB\""}'::jsonb[]))) OR (((key)::text = 'product'::text) AND (operator = 1) AND (value = ANY ('{"\"BB\"","\"AA\""}'::jsonb[]))) OR (((key)::text = 'product'::text) AND (operator = 7) AND (value @> '["BB", "AA"]'::jsonb)) OR (((key)::text = 'product'::text) AND (operator = 2) AND (value <> ALL ('{"\"BB\"","\"AA\""}'::jsonb[]))) OR (((key)::text = 'style'::text) AND (operator = 1) AND (value = ANY ('{"\"A\"","\"B\""}'::jsonb[]))) OR (((key)::text = 'style'::text) AND (operator = 7) AND (value @> '["A", "B"]'::jsonb)) OR (((key)::text = 'style'::text) AND (operator = 2) AND (value <> ALL ('{"\"A\"","\"B\""}'::jsonb[]))) OR (((key)::text = 'item_type'::text) AND (operator = 1) AND (value = '1'::jsonb)) OR (((key)::text = 'item_type'::text) AND (operator = 7) AND (value @> '[1]'::jsonb)) OR (((key)::text = 'item_type'::text) AND (operator = 2) AND (value <> '1'::jsonb)) OR (((key)::text = 'item_type'::text) AND (operator = 3) AND (value < '1'::jsonb)) OR (((key)::text = 'item_type'::text) AND (operator = 4) AND (value <= '1'::jsonb)) OR (((key)::text = 'item_type'::text) AND (operator = 5) AND (value > '1'::jsonb)) OR (((key)::text = 'item_type'::text) AND (operator = 6) AND (value >= '1'::jsonb)) OR (((key)::text = 'category'::text) AND (operator = 1) AND (value = ANY ('{"\"clothing\"","\"shirts\"","\"t-shirt\"","\"high-waist\"","\"jeans\""}'::jsonb[]))) OR (((key)::text = 'category'::text) AND (operator = 7) AND (value @> '["clothing", "shirts", "t-shirt", "high-waist", "jeans"]'::jsonb)) OR (((key)::text = 'category'::text) AND (operator = 2) AND (value <> ALL ('{"\"clothing\"","\"shirts\"","\"t-shirt\"","\"high-waist\"","\"jeans\""}'::jsonb[]))))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=5009
5. 50.090 50.090 ↑ 3.0 1 5,009

Bitmap Index Scan on promotion_criterion_price_rule_id_3c1aaf6c (cost=0.00..4.30 rows=3 width=0) (actual time=0.010..0.010 rows=1 loops=5,009)

  • Index Cond: (price_rule_id = promotion_pricerule.id)
Planning time : 0.855 ms
Execution time : 259.067 ms