explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bQOl

Settings
# exclusive inclusive rows x rows loops node
1. 22.659 81.420 ↓ 3.8 22,832 1

HashAggregate (cost=17,547.22..17,607.39 rows=6,017 width=36) (actual time=72.937..81.420 rows=22,832 loops=1)

  • Group Key: product_id
2. 27.662 58.761 ↓ 3.2 22,832 1

Bitmap Heap Scan on product_price_caches (cost=8,214.67..17,511.55 rows=7,135 width=8) (actual time=33.034..58.761 rows=22,832 loops=1)

  • Recheck Cond: (((user_role)::text = 'consumer'::text) AND (color_option_id IS NULL) AND (sku_id IS NULL) AND (promotion_store_id IS NULL))
  • Filter: ((price_group_id IS NULL) AND (((promotion_start_date <= '2019-03-08 10:20:55.881621'::timestamp without time zone) AND (promotion_end_date IS NULL) AND ((promotion_sale_type)::text = 'sale'::text)) OR ((promotion_start_date <= '2019-03-08 10:20:55.881621'::timestamp without time zone) AND (promotion_end_date >= '2019-03-08 10:20:55.881621'::timestamp without time zone) AND ((promotion_sale_type)::text = 'sale'::text)) OR ((promotion_start_date IS NULL) AND (promotion_end_date IS NULL) AND ((promotion_sale_type)::text = 'outlet'::text)) OR ((promotion_start_date <= '2019-03-08 10:20:55.881621'::timestamp without time zone) AND (promotion_end_date IS NULL) AND ((promotion_sale_type)::text = 'outlet'::text)) OR ((promotion_start_date IS NULL) AND (promotion_end_date >= '2019-03-08 10:20:55.881621'::timestamp without time zone) AND ((promotion_sale_type)::text = 'outlet'::text)) OR ((promotion_start_date <= '2019-03-08 10:20:55.881621'::timestamp without time zone) AND (promotion_end_date >= '2019-03-08 10:20:55.881621'::timestamp without time zone) AND ((promotion_sale_type)::text = 'outlet'::text)) OR ((promotion_start_date <= '2019-03-08 10:20:55.881621'::timestamp without time zone) AND (promotion_end_date >= '2019-03-08 10:20:55.881621'::timestamp without time zone) AND ((promotion_sale_type)::text = 'promotion'::text)) OR ((promotion_start_date IS NULL) AND (promotion_end_date IS NULL) AND (promotion_sale_type IS NULL))))
  • Rows Removed by Filter: 1017
  • Heap Blocks: exact=8533
3. 31.099 31.099 ↓ 3.2 23,849 1

Bitmap Index Scan on idx_product_price_caches_main (cost=0.00..8,212.89 rows=7,444 width=0) (actual time=31.099..31.099 rows=23,849 loops=1)

  • Index Cond: (((user_role)::text = 'consumer'::text) AND (color_option_id IS NULL) AND (sku_id IS NULL) AND (promotion_store_id IS NULL))