explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9m96

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 8.637 ↑ 1.0 1 1

Nested Loop (cost=248.29..268.20 rows=1 width=1,673) (actual time=8.631..8.637 rows=1 loops=1)

2. 0.022 8.600 ↑ 1.0 1 1

Bitmap Heap Scan on promotion_criterion (cost=248.01..259.90 rows=1 width=4) (actual time=8.596..8.600 rows=1 loops=1)

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

BitmapOr (cost=248.01..248.01 rows=3 width=0) (actual time=8.577..8.578 rows=0 loops=1)

4. 0.018 0.018 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_9dc3e6_idx (cost=0.00..4.42 rows=1 width=0) (actual time=0.017..0.018 rows=0 loops=1)

  • Index Cond: (((key)::text = 'market'::text) AND (value = '"SE"'::jsonb) AND (operator = 1))
5. 0.006 0.006 ↓ 0.0 0 1

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

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

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

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

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

  • Index Cond: (((key)::text = 'store'::text) AND (value = '"10010"'::jsonb) AND (operator = 1))
8. 0.006 0.006 ↓ 0.0 0 1

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

  • Index Cond: (((key)::text = 'store'::text) AND (operator = 7))
9. 0.006 0.006 ↓ 0.0 0 1

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

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

Bitmap Index Scan on promotion_c_key_9dc3e6_idx (cost=0.00..4.42 rows=1 width=0) (actual time=0.017..0.018 rows=0 loops=1)

  • Index Cond: (((key)::text = 'cart_total'::text) AND (value = '123.0'::jsonb) AND (operator = 1))
11. 0.006 0.006 ↓ 0.0 0 1

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

  • Index Cond: (((key)::text = 'cart_total'::text) AND (operator = 7))
12. 0.006 0.006 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_9dc3e6_idx (cost=0.00..12.74 rows=1 width=0) (actual time=0.004..0.006 rows=0 loops=1)

  • Index Cond: (((key)::text = 'cart_total'::text) AND (operator = 2))
13. 0.013 0.013 ↑ 1.0 1 1

Bitmap Index Scan on promotion_c_key_9dc3e6_idx (cost=0.00..4.42 rows=1 width=0) (actual time=0.012..0.013 rows=1 loops=1)

  • Index Cond: (((key)::text = 'sku'::text) AND (value = '"AAA"'::jsonb) AND (operator = 1))
14. 4.365 4.365 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_9dc3e6_idx (cost=0.00..12.74 rows=1 width=0) (actual time=4.364..4.365 rows=0 loops=1)

  • Index Cond: (((key)::text = 'sku'::text) AND (operator = 7))
15. 4.023 4.023 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_9dc3e6_idx (cost=0.00..12.74 rows=1 width=0) (actual time=4.022..4.023 rows=0 loops=1)

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

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

  • Index Cond: (((key)::text = 'product'::text) AND (value = '"AA"'::jsonb) AND (operator = 1))
17. 0.006 0.006 ↓ 0.0 0 1

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

  • Index Cond: (((key)::text = 'product'::text) AND (operator = 7))
18. 0.006 0.006 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_9dc3e6_idx (cost=0.00..12.74 rows=1 width=0) (actual time=0.004..0.006 rows=0 loops=1)

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

Bitmap Index Scan on promotion_c_key_9dc3e6_idx (cost=0.00..4.42 rows=1 width=0) (actual time=0.005..0.007 rows=0 loops=1)

  • Index Cond: (((key)::text = 'style'::text) AND (value = '"A"'::jsonb) AND (operator = 1))
20. 0.006 0.006 ↓ 0.0 0 1

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

  • Index Cond: (((key)::text = 'style'::text) AND (operator = 7))
21. 0.006 0.006 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_9dc3e6_idx (cost=0.00..12.74 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.006 0.006 ↓ 0.0 0 1

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

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

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

  • Index Cond: (((key)::text = 'item_type'::text) AND (operator = 7))
24. 0.005 0.005 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_9dc3e6_idx (cost=0.00..12.74 rows=1 width=0) (actual time=0.004..0.005 rows=0 loops=1)

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

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

  • Index Cond: (((key)::text = 'category'::text) AND (value = ANY ('{"\"jeans\"","\"clothing\"","\"high-waist\""}'::jsonb[])) AND (operator = 1))
26. 0.005 0.005 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_9dc3e6_idx (cost=0.00..12.74 rows=1 width=0) (actual time=0.004..0.005 rows=0 loops=1)

  • Index Cond: (((key)::text = 'category'::text) AND (operator = 7))
27. 0.005 0.005 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_9dc3e6_idx (cost=0.00..12.74 rows=1 width=0) (actual time=0.004..0.005 rows=0 loops=1)

  • Index Cond: (((key)::text = 'category'::text) AND (operator = 2))
28. 0.026 0.026 ↑ 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.025..0.026 rows=1 loops=1)

  • Index Cond: (id = promotion_criterion.price_rule_id)
Planning time : 1.119 ms
Execution time : 9.291 ms