explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kkdQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 0.067 ↑ 1.0 1 1

Nested Loop (cost=9.22..11.25 rows=1 width=584) (actual time=0.064..0.067 rows=1 loops=1)

2.          

CTE campaigns_active_with_stores

3. 0.007 0.032 ↑ 1.0 1 1

Nested Loop (cost=0.14..9.21 rows=1 width=552) (actual time=0.030..0.032 rows=1 loops=1)

4. 0.009 0.009 ↓ 2.0 2 1

Seq Scan on campaign_conditions (cost=0.00..1.04 rows=1 width=36) (actual time=0.009..0.009 rows=2 loops=1)

  • Filter: (condition_type_id = 8)
  • Rows Removed by Filter: 6
5. 0.016 0.016 ↓ 0.0 0 2

Index Scan using campaigns_pkey on campaigns (cost=0.14..8.16 rows=1 width=520) (actual time=0.007..0.008 rows=0 loops=2)

  • Index Cond: (id = campaign_conditions.campaign_id)
  • Filter: (active AND (now() >= starts_at) AND (now() <= ends_at))
  • Rows Removed by Filter: 0
6. 0.034 0.034 ↑ 1.0 1 1

CTE Scan on campaigns_active_with_stores (cost=0.00..0.02 rows=1 width=552) (actual time=0.032..0.034 rows=1 loops=1)

7. 0.031 0.031 ↑ 1.0 1 1

Function Scan on jsonb_array_elements (cost=0.00..2.00 rows=1 width=32) (actual time=0.031..0.031 rows=1 loops=1)

  • Filter: (replace((value)::text, '"'::text, ''::text) = 'f4666006-4be6-437e-8dc8-59ed9e2746e6'::text)