explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6s1r

Settings
# exclusive inclusive rows x rows loops node
1. 0.032 66.226 ↑ 1.0 1 1

Nested Loop (cost=560.32..580.23 rows=1 width=1,673) (actual time=66.216..66.226 rows=1 loops=1)

2. 54.958 66.164 ↑ 1.0 1 1

Bitmap Heap Scan on promotion_criterion (cost=560.03..571.92 rows=1 width=4) (actual time=66.157..66.164 rows=1 loops=1)

  • Recheck Cond: ((((key)::text = 'market'::text) AND (operator = 1)) OR ((value @> '["SE"]'::jsonb) AND ((key)::text = 'market'::text) AND (operator = 7)) OR (((key)::text = 'market'::text) AND (operator = 2)) OR (((key)::text = 'store'::text) AND (operator = 1)) OR ((value @> '["10010"]'::jsonb) AND ((key)::text = 'store'::text) AND (operator = 7)) OR (((key)::text = 'store'::text) AND (operator = 2)) OR (((key)::text = 'cart_total'::text) AND (operator = 1)) OR ((value @> '[123.0]'::jsonb) AND ((key)::text = 'cart_total'::text) AND (operator = 7)) OR (((key)::text = 'cart_total'::text) AND (operator = 2)) OR (((key)::text = 'sku'::text) AND (operator = 1)) OR ((value @> '["AAA"]'::jsonb) AND ((key)::text = 'sku'::text) AND (operator = 7)) OR (((key)::text = 'sku'::text) AND (operator = 2)) OR (((key)::text = 'product'::text) AND (operator = 1)) OR ((value @> '["AA"]'::jsonb) AND ((key)::text = 'product'::text) AND (operator = 7)) OR (((key)::text = 'product'::text) AND (operator = 2)) OR (((key)::text = 'style'::text) AND (operator = 1)) OR ((value @> '["A"]'::jsonb) AND ((key)::text = 'style'::text) AND (operator = 7)) OR (((key)::text = 'style'::text) AND (operator = 2)) OR (((key)::text = 'item_type'::text) AND (operator = 1)) OR ((value @> '[1]'::jsonb) AND ((key)::text = 'item_type'::text) AND (operator = 7)) OR (((key)::text = 'item_type'::text) AND (operator = 2)) OR (((key)::text = 'category'::text) AND (operator = 1)) OR ((value @> '["high-waist", "jeans", "clothing"]'::jsonb) AND ((key)::text = 'category'::text) AND (operator = 7)) OR (((key)::text = 'category'::text) AND (operator = 2)))
  • Filter: ((((key)::text = 'market'::text) AND (operator = 1) AND (value = '"SE"'::jsonb)) OR (((key)::text = 'market'::text) AND (operator = 7) AND (value @> '["SE"]'::jsonb)) OR (((key)::text = 'market'::text) AND (operator = 2) AND (value <> '"SE"'::jsonb)) OR (((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 = 'sku'::text) AND (operator = 1) AND (value = '"AAA"'::jsonb)) OR (((key)::text = 'sku'::text) AND (operator = 7) AND (value @> '["AAA"]'::jsonb)) OR (((key)::text = 'sku'::text) AND (operator = 2) AND (value <> '"AAA"'::jsonb)) OR (((key)::text = 'product'::text) AND (operator = 1) AND (value = '"AA"'::jsonb)) OR (((key)::text = 'product'::text) AND (operator = 7) AND (value @> '["AA"]'::jsonb)) OR (((key)::text = 'product'::text) AND (operator = 2) AND (value <> '"AA"'::jsonb)) OR (((key)::text = 'style'::text) AND (operator = 1) AND (value = '"A"'::jsonb)) OR (((key)::text = 'style'::text) AND (operator = 7) AND (value @> '["A"]'::jsonb)) OR (((key)::text = 'style'::text) AND (operator = 2) AND (value <> '"A"'::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 = 'category'::text) AND (operator = 1) AND (value = ANY ('{"\"high-waist\"","\"jeans\"","\"clothing\""}'::jsonb[]))) OR (((key)::text = 'category'::text) AND (operator = 7) AND (value @> '["high-waist", "jeans", "clothing"]'::jsonb)) OR (((key)::text = 'category'::text) AND (operator = 2) AND (value <> ALL ('{"\"high-waist\"","\"jeans\"","\"clothing\""}'::jsonb[]))))
  • Rows Removed by Filter: 50002
  • Heap Blocks: exact=515
3. 0.013 11.206 ↓ 0.0 0 1

BitmapOr (cost=560.03..560.03 rows=3 width=0) (actual time=11.205..11.206 rows=0 loops=1)

4. 0.109 0.109 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=0.108..0.109 rows=0 loops=1)

  • Index Cond: (((key)::text = 'market'::text) AND (operator = 1))
5. 0.012 0.012 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..28.00 rows=1 width=0) (actual time=0.011..0.012 rows=0 loops=1)

  • Index Cond: ((value @> '["SE"]'::jsonb) AND ((key)::text = 'market'::text) AND (operator = 7))
6. 0.007 0.007 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=0.006..0.007 rows=0 loops=1)

  • Index Cond: (((key)::text = 'market'::text) AND (operator = 2))
7. 0.091 0.091 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=0.089..0.091 rows=0 loops=1)

  • Index Cond: (((key)::text = 'store'::text) AND (operator = 1))
8. 0.025 0.025 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..28.00 rows=1 width=0) (actual time=0.023..0.025 rows=0 loops=1)

  • Index Cond: ((value @> '["10010"]'::jsonb) AND ((key)::text = 'store'::text) AND (operator = 7))
9. 0.022 0.022 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=0.021..0.022 rows=0 loops=1)

  • Index Cond: (((key)::text = 'store'::text) AND (operator = 2))
10. 0.060 0.060 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=0.058..0.060 rows=0 loops=1)

  • Index Cond: (((key)::text = 'cart_total'::text) AND (operator = 1))
11. 0.014 0.014 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..28.00 rows=1 width=0) (actual time=0.013..0.014 rows=0 loops=1)

  • Index Cond: ((value @> '[123.0]'::jsonb) AND ((key)::text = 'cart_total'::text) AND (operator = 7))
12. 0.009 0.009 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=0.008..0.009 rows=0 loops=1)

  • Index Cond: (((key)::text = 'cart_total'::text) AND (operator = 2))
13. 10.418 10.418 ↓ 50,006.0 50,006 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=10.417..10.418 rows=50,006 loops=1)

  • Index Cond: (((key)::text = 'sku'::text) AND (operator = 1))
14. 0.077 0.077 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..28.00 rows=1 width=0) (actual time=0.076..0.077 rows=0 loops=1)

  • Index Cond: ((value @> '["AAA"]'::jsonb) AND ((key)::text = 'sku'::text) AND (operator = 7))
15. 0.051 0.051 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=0.050..0.051 rows=0 loops=1)

  • Index Cond: (((key)::text = 'sku'::text) AND (operator = 2))
16. 0.048 0.048 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=0.047..0.048 rows=0 loops=1)

  • Index Cond: (((key)::text = 'product'::text) AND (operator = 1))
17. 0.020 0.020 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..28.00 rows=1 width=0) (actual time=0.019..0.020 rows=0 loops=1)

  • Index Cond: ((value @> '["AA"]'::jsonb) AND ((key)::text = 'product'::text) AND (operator = 7))
18. 0.007 0.007 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=0.006..0.007 rows=0 loops=1)

  • Index Cond: (((key)::text = 'product'::text) AND (operator = 2))
19. 0.048 0.048 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=0.047..0.048 rows=0 loops=1)

  • Index Cond: (((key)::text = 'style'::text) AND (operator = 1))
20. 0.010 0.010 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..28.00 rows=1 width=0) (actual time=0.009..0.010 rows=0 loops=1)

  • Index Cond: ((value @> '["A"]'::jsonb) AND ((key)::text = 'style'::text) AND (operator = 7))
21. 0.006 0.006 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=0.005..0.006 rows=0 loops=1)

  • Index Cond: (((key)::text = 'style'::text) AND (operator = 2))
22. 0.047 0.047 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=0.046..0.047 rows=0 loops=1)

  • Index Cond: (((key)::text = 'item_type'::text) AND (operator = 1))
23. 0.011 0.011 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..28.00 rows=1 width=0) (actual time=0.010..0.011 rows=0 loops=1)

  • Index Cond: ((value @> '[1]'::jsonb) AND ((key)::text = 'item_type'::text) AND (operator = 7))
24. 0.010 0.010 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=0.009..0.010 rows=0 loops=1)

  • Index Cond: (((key)::text = 'item_type'::text) AND (operator = 2))
25. 0.055 0.055 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=0.054..0.055 rows=0 loops=1)

  • Index Cond: (((key)::text = 'category'::text) AND (operator = 1))
26. 0.026 0.026 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..44.00 rows=1 width=0) (actual time=0.025..0.026 rows=0 loops=1)

  • Index Cond: ((value @> '["high-waist", "jeans", "clothing"]'::jsonb) AND ((key)::text = 'category'::text) AND (operator = 7))
27. 0.010 0.010 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_value_52dbfb_gin (cost=0.00..20.00 rows=1 width=0) (actual time=0.008..0.010 rows=0 loops=1)

  • Index Cond: (((key)::text = 'category'::text) AND (operator = 2))
28. 0.030 0.030 ↑ 1.0 1 1

Index Scan using promotion_pricerule_pkey on promotion_pricerule (cost=0.28..8.30 rows=1 width=1,673) (actual time=0.029..0.030 rows=1 loops=1)

  • Index Cond: (id = promotion_criterion.price_rule_id)
Planning time : 1.167 ms
Execution time : 66.992 ms