explain.depesz.com

PostgreSQL's explain analyze made readable

Result: e5K5

Settings
# exclusive inclusive rows x rows loops node
1. 0.127 1.116 ↓ 5.0 5 1

Nested Loop (cost=154.69..169.24 rows=1 width=1,685) (actual time=0.912..1.116 rows=5 loops=1)

2. 0.086 0.929 ↓ 5.0 5 1

Bitmap Heap Scan on promotion_criterion (cost=154.41..158.65 rows=1 width=4) (actual time=0.871..0.929 rows=5 loops=1)

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

BitmapOr (cost=154.41..154.41 rows=1 width=0) (actual time=0.835..0.843 rows=0 loops=1)

4. 0.039 0.039 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.031..0.039 rows=0 loops=1)

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

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.010..0.018 rows=0 loops=1)

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

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.009..0.017 rows=0 loops=1)

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

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.030..0.037 rows=0 loops=1)

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

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.007..0.015 rows=0 loops=1)

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

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.008..0.016 rows=0 loops=1)

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

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.009..0.017 rows=0 loops=1)

  • Index Cond: (((key)::text = 'cart_total'::text) AND (operator = 3) AND (value <= '123.0'::jsonb))
11. 0.015 0.015 ↑ 1.0 1 1

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.007..0.015 rows=1 loops=1)

  • Index Cond: (((key)::text = 'cart_total'::text) AND (operator = 4) AND (value < '123.0'::jsonb))
12. 0.018 0.018 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.010..0.018 rows=0 loops=1)

  • Index Cond: (((key)::text = 'cart_total'::text) AND (operator = 5) AND (value >= '123.0'::jsonb))
13. 0.017 0.017 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.009..0.017 rows=0 loops=1)

  • Index Cond: (((key)::text = 'cart_total'::text) AND (operator = 6) AND (value > '123.0'::jsonb))
14. 0.154 0.154 ↓ 2.0 2 1

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..8.58 rows=1 width=0) (actual time=0.146..0.154 rows=2 loops=1)

  • Index Cond: (((key)::text = 'sku'::text) AND (operator = 1) AND (value = ANY ('{"\"AAA\"","\"BBB\""}'::jsonb[])))
15. 0.018 0.018 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.010..0.018 rows=0 loops=1)

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

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.008..0.016 rows=0 loops=1)

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

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..8.58 rows=1 width=0) (actual time=0.020..0.027 rows=0 loops=1)

  • Index Cond: (((key)::text = 'product'::text) AND (operator = 1) AND (value = ANY ('{"\"BB\"","\"AA\""}'::jsonb[])))
18. 0.022 0.022 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.015..0.022 rows=0 loops=1)

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

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.016..0.023 rows=0 loops=1)

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

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..8.58 rows=1 width=0) (actual time=0.023..0.031 rows=0 loops=1)

  • Index Cond: (((key)::text = 'style'::text) AND (operator = 1) AND (value = ANY ('{"\"B\"","\"A\""}'::jsonb[])))
21. 0.019 0.019 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.012..0.019 rows=0 loops=1)

  • Index Cond: (((key)::text = 'style'::text) AND (operator = 7))
22. 0.023 0.023 ↑ 1.0 1 1

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.015..0.023 rows=1 loops=1)

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

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.013..0.021 rows=0 loops=1)

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

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.010..0.018 rows=0 loops=1)

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

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.024..0.031 rows=0 loops=1)

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

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.009..0.017 rows=0 loops=1)

  • Index Cond: (((key)::text = 'item_type'::text) AND (operator = 3) AND (value <= '1'::jsonb))
27. 0.015 0.015 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.008..0.015 rows=0 loops=1)

  • Index Cond: (((key)::text = 'item_type'::text) AND (operator = 4) AND (value < '1'::jsonb))
28. 0.017 0.017 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.010..0.017 rows=0 loops=1)

  • Index Cond: (((key)::text = 'item_type'::text) AND (operator = 5) AND (value >= '1'::jsonb))
29. 0.018 0.018 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.009..0.018 rows=0 loops=1)

  • Index Cond: (((key)::text = 'item_type'::text) AND (operator = 6) AND (value > '1'::jsonb))
30. 0.036 0.036 ↓ 0.0 0 1

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..21.45 rows=1 width=0) (actual time=0.027..0.036 rows=0 loops=1)

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

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.010..0.017 rows=0 loops=1)

  • Index Cond: (((key)::text = 'category'::text) AND (operator = 7))
32. 0.021 0.021 ↑ 1.0 1 1

Bitmap Index Scan on promotion_c_key_7b1368_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.013..0.021 rows=1 loops=1)

  • Index Cond: (((key)::text = 'category'::text) AND (operator = 2))
33. 0.060 0.060 ↑ 1.0 1 5

Index Scan using promotion_pricerule_pkey on promotion_pricerule (cost=0.28..8.30 rows=1 width=1,685) (actual time=0.010..0.012 rows=1 loops=5)

  • Index Cond: (id = promotion_criterion.price_rule_id)
  • Filter: (type = 2)
Planning time : 0.681 ms
Execution time : 2.081 ms