explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4vBR

Settings
# exclusive inclusive rows x rows loops node
1. 0.149 91.081 ↑ 164.5 6 1

Hash Semi Join (cost=1,178.87..1,434.33 rows=987 width=103) (actual time=89.613..91.081 rows=6 loops=1)

  • Hash Cond: (promotion_pricerule.id = u0.price_rule_id)
2. 1.379 1.379 ↑ 221.1 10 1

Seq Scan on promotion_pricerule (cost=0.00..238.68 rows=2,211 width=103) (actual time=0.014..1.379 rows=10 loops=1)

  • Filter: (is_active AND (type = ANY ('{1,2}'::integer[])) AND ((market_code)::text = 'SE'::text))
  • Rows Removed by Filter: 7504
3. 40.566 89.553 ↓ 1.5 5,009 1

Hash (cost=1,137.31..1,137.31 rows=3,325 width=4) (actual time=89.547..89.553 rows=5,009 loops=1)

  • Buckets: 8192 (originally 4096) Batches: 1 (originally 1) Memory Usage: 241kB
4. 46.500 48.987 ↓ 1.5 5,009 1

Bitmap Heap Scan on promotion_criterion u0 (cost=284.23..1,137.31 rows=3,325 width=4) (actual time=2.534..48.987 rows=5,009 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 ('{"\"AA\"","\"BB\""}'::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 ('{"\"A\"","\"B\""}'::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 ('{"\"clothing\"","\"t-shirt\"","\"high-waist\"","\"jeans\"","\"shirts\""}'::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 ('{"\"AA\"","\"BB\""}'::jsonb[]))) OR (((key)::text = 'product'::text) AND (operator = 7) AND (value @> '["AA", "BB"]'::jsonb)) OR (((key)::text = 'product'::text) AND (operator = 2) AND (value <> ALL ('{"\"AA\"","\"BB\""}'::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\"","\"t-shirt\"","\"high-waist\"","\"jeans\"","\"shirts\""}'::jsonb[]))) OR (((key)::text = 'category'::text) AND (operator = 7) AND (value @> '["clothing", "t-shirt", "high-waist", "jeans", "shirts"]'::jsonb)) OR (((key)::text = 'category'::text) AND (operator = 2) AND (value <> ALL ('{"\"clothing\"","\"t-shirt\"","\"high-waist\"","\"jeans\"","\"shirts\""}'::jsonb[]))))
  • Heap Blocks: exact=71
5. 0.166 2.487 ↓ 0.0 0 1

BitmapOr (cost=284.23..284.23 rows=3,328 width=0) (actual time=2.481..2.487 rows=0 loops=1)

6. 0.023 0.023 ↓ 0.0 0 1

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

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

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

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

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

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

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

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

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

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

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

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

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

  • Index Cond: (((key)::text = 'cart_total'::text) AND (operator = 3) AND (value < '123.0'::jsonb))
13. 0.111 0.111 ↓ 2.0 2 1

Bitmap Index Scan on criterion_key_op_value_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.105..0.111 rows=2 loops=1)

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

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

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

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

  • Index Cond: (((key)::text = 'cart_total'::text) AND (operator = 6) AND (value >= '123.0'::jsonb))
16. 1.700 1.700 ↓ 1.5 5,004 1

Bitmap Index Scan on criterion_key_op_value_idx (cost=0.00..114.12 rows=3,325 width=0) (actual time=1.694..1.700 rows=5,004 loops=1)

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

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

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

Bitmap Index Scan on criterion_key_op_value_idx (cost=0.00..4.30 rows=2 width=0) (actual time=0.011..0.017 rows=0 loops=1)

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

Bitmap Index Scan on criterion_key_op_value_idx (cost=0.00..8.59 rows=1 width=0) (actual time=0.016..0.022 rows=0 loops=1)

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

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

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

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

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

Bitmap Index Scan on criterion_key_op_value_idx (cost=0.00..8.59 rows=1 width=0) (actual time=0.014..0.020 rows=0 loops=1)

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

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

  • Index Cond: (((key)::text = 'style'::text) AND (operator = 7))
24. 0.018 0.018 ↓ 2.0 2 1

Bitmap Index Scan on criterion_key_op_value_idx (cost=0.00..4.29 rows=1 width=0) (actual time=0.012..0.018 rows=2 loops=1)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Bitmap Index Scan on criterion_key_op_value_idx (cost=0.00..21.48 rows=1 width=0) (actual time=0.021..0.027 rows=0 loops=1)

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

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

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

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

  • Index Cond: (((key)::text = 'category'::text) AND (operator = 2))
Planning time : 2.127 ms
Execution time : 91.992 ms