explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lQYH

Settings
# exclusive inclusive rows x rows loops node
1. 0.081 5.155 ↑ 411.0 5 1

Unique (cost=1,480.54..1,490.82 rows=2,055 width=4) (actual time=5.044..5.155 rows=5 loops=1)

2. 0.097 5.074 ↑ 411.0 5 1

Sort (cost=1,480.54..1,485.68 rows=2,055 width=4) (actual time=5.030..5.074 rows=5 loops=1)

  • Sort Key: price_rule_id
  • Sort Method: quicksort Memory: 25kB
3. 0.082 4.977 ↑ 411.0 5 1

Bitmap Heap Scan on promotion_criterion (cost=676.75..1,367.47 rows=2,055 width=4) (actual time=4.928..4.977 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 ('{"\"BBB\"","\"AAA\""}'::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 ('{"\"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 ('{"\"high-waist\"","\"jeans\"","\"clothing\"","\"shirts\"","\"t-shirt\""}'::jsonb[]))) OR (((key)::text = 'category'::text) AND (operator = 7)) OR (((key)::text = 'category'::text) AND (operator = 2))) AND ((market_code)::text = 'SE'::text) AND (type = ANY ('{1,2}'::integer[])) AND (from_date <= '2020-03-25 16:34:03.074862+00'::timestamp with time zone) AND (to_date > '2020-03-25 16:34:03.074862+00'::timestamp with time zone))
  • Filter: (is_active AND ((((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 ('{"\"BBB\"","\"AAA\""}'::jsonb[]))) OR (((key)::text = 'sku'::text) AND (operator = 7) AND (value @> '["BBB", "AAA"]'::jsonb)) OR (((key)::text = 'sku'::text) AND (operator = 2) AND (value <> ALL ('{"\"BBB\"","\"AAA\""}'::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 ('{"\"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 ('{"\"high-waist\"","\"jeans\"","\"clothing\"","\"shirts\"","\"t-shirt\""}'::jsonb[]))) OR (((key)::text = 'category'::text) AND (operator = 7) AND (value @> '["high-waist", "jeans", "clothing", "shirts", "t-shirt"]'::jsonb)) OR (((key)::text = 'category'::text) AND (operator = 2) AND (value <> ALL ('{"\"high-waist\"","\"jeans\"","\"clothing\"","\"shirts\"","\"t-shirt\""}'::jsonb[])))))
  • Heap Blocks: exact=1
4. 0.028 4.895 ↓ 0.0 0 1

BitmapAnd (cost=676.75..676.75 rows=2,056 width=0) (actual time=4.889..4.895 rows=0 loops=1)

5. 0.049 3.635 ↓ 0.0 0 1

BitmapOr (cost=314.68..314.68 rows=4,572 width=0) (actual time=3.629..3.635 rows=0 loops=1)

6. 0.088 0.088 ↓ 0.0 0 1

Bitmap Index Scan on criterion_key_op_value_idx (cost=0.00..4.30 rows=1 width=0) (actual time=0.082..0.088 rows=0 loops=1)

  • Index Cond: (((key)::text = 'store'::text) AND (operator = 1) AND (value = '"10010"'::jsonb))
7. 0.039 0.039 ↓ 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.033..0.039 rows=0 loops=1)

  • Index Cond: (((key)::text = 'store'::text) AND (operator = 7))
8. 0.075 0.075 ↓ 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.069..0.075 rows=0 loops=1)

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

Bitmap Index Scan on criterion_key_op_value_idx (cost=0.00..4.30 rows=1 width=0) (actual time=0.038..0.044 rows=0 loops=1)

  • Index Cond: (((key)::text = 'cart_total'::text) AND (operator = 1) AND (value = '123.0'::jsonb))
10. 0.020 0.020 ↓ 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.014..0.020 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.30 rows=1 width=0) (actual time=0.013..0.018 rows=0 loops=1)

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

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

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

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

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

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

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

Bitmap Index Scan on criterion_key_op_value_idx (cost=0.00..153.69 rows=4,570 width=0) (actual time=2.900..2.906 rows=8,004 loops=1)

  • Index Cond: (((key)::text = 'sku'::text) AND (operator = 1) AND (value = ANY ('{"\"BBB\"","\"AAA\""}'::jsonb[])))
17. 0.016 0.016 ↓ 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.010..0.016 rows=0 loops=1)

  • Index Cond: (((key)::text = 'sku'::text) AND (operator = 7))
18. 0.015 0.015 ↓ 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.009..0.015 rows=0 loops=1)

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

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

  • Index Cond: (((key)::text = 'product'::text) AND (operator = 1) AND (value = ANY ('{"\"AA\"","\"BB\""}'::jsonb[])))
20. 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 = 'product'::text) AND (operator = 7))
21. 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 = 'product'::text) AND (operator = 2))
22. 0.017 0.017 ↓ 0.0 0 1

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

  • Index Cond: (((key)::text = 'style'::text) AND (operator = 1) AND (value = ANY ('{"\"B\"","\"A\""}'::jsonb[])))
23. 0.016 0.016 ↓ 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.010..0.016 rows=0 loops=1)

  • Index Cond: (((key)::text = 'style'::text) AND (operator = 7))
24. 0.016 0.016 ↓ 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.010..0.016 rows=2 loops=1)

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

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

  • Index Cond: (((key)::text = 'item_type'::text) AND (operator = 1) AND (value = '1'::jsonb))
26. 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 = 'item_type'::text) AND (operator = 7))
27. 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 = 'item_type'::text) AND (operator = 2))
28. 0.016 0.016 ↓ 0.0 0 1

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

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

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

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

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

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

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

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

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

  • Index Cond: (((key)::text = 'category'::text) AND (operator = 1) AND (value = ANY ('{"\"high-waist\"","\"jeans\"","\"clothing\"","\"shirts\"","\"t-shirt\""}'::jsonb[])))
33. 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 = 'category'::text) AND (operator = 7))
34. 0.017 0.017 ↑ 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.011..0.017 rows=1 loops=1)

  • Index Cond: (((key)::text = 'category'::text) AND (operator = 2))
35. 1.232 1.232 ↑ 1.6 4,009 1

Bitmap Index Scan on criterion_etc_idx (cost=0.00..361.30 rows=6,301 width=0) (actual time=1.226..1.232 rows=4,009 loops=1)

  • Index Cond: (((market_code)::text = 'SE'::text) AND (type = ANY ('{1,2}'::integer[])) AND (is_active = true) AND (from_date <= '2020-03-25 16:34:03.074862+00'::timestamp with time zone) AND (to_date > '2020-03-25 16:34:03.074862+00'::timestamp with time zone))
Planning time : 2.114 ms
Execution time : 6.292 ms