explain.depesz.com

PostgreSQL's explain analyze made readable

Result: n22r

Settings
# exclusive inclusive rows x rows loops node
1. 0.367 4.854 ↓ 51.2 256 1

Nested Loop (cost=302.71..396.64 rows=5 width=754) (actual time=3.846..4.854 rows=256 loops=1)

2.          

CTE place_timezone_info

3. 0.006 0.034 ↑ 62.5 16 1

Result (cost=0.09..14.60 rows=1,000 width=58) (actual time=0.025..0.034 rows=16 loops=1)

4. 0.016 0.028 ↑ 62.5 16 1

ProjectSet (cost=0.09..5.60 rows=1,000 width=266) (actual time=0.023..0.028 rows=16 loops=1)

5. 0.012 0.012 ↑ 1.0 1 1

Index Scan using index_places_on_company_id_status_null on places (cost=0.09..4.09 rows=1 width=258) (actual time=0.011..0.012 rows=1 loops=1)

  • Index Cond: ((company_id = 3144) AND (id = 24106205))
  • Filter: ((name)::text <> 'NEW PLACE'::text)
6. 0.020 4.407 ↓ 16.0 16 1

Nested Loop (cost=288.11..375.48 rows=1 width=170) (actual time=3.812..4.407 rows=16 loops=1)

7. 0.030 4.243 ↓ 36.0 72 1

Nested Loop (cost=288.00..371.66 rows=2 width=170) (actual time=3.800..4.243 rows=72 loops=1)

8. 0.240 4.003 ↓ 23.3 70 1

Bitmap Heap Scan on campaigns (cost=287.91..347.41 rows=3 width=166) (actual time=3.788..4.003 rows=70 loops=1)

  • Recheck Cond: ((company_id = 3144) AND ((state)::text = 'published'::text))
  • Filter: ((metadata IS NOT NULL) AND exist(metadata, 'start_at'::text) AND exist(metadata, 'end_at'::text))
  • Rows Removed by Filter: 52
  • Heap Blocks: exact=110
9. 0.050 3.763 ↓ 0.0 0 1

BitmapAnd (cost=287.91..287.91 rows=30 width=0) (actual time=3.763..3.763 rows=0 loops=1)

10. 0.095 0.095 ↑ 1.0 787 1

Bitmap Index Scan on index_campaigns_on_company_id (cost=0.00..7.31 rows=814 width=0) (actual time=0.095..0.095 rows=787 loops=1)

  • Index Cond: (company_id = 3144)
11. 3.618 3.618 ↓ 1.0 42,809 1

Bitmap Index Scan on index_campaigns_on_id_state_published (cost=0.00..280.56 rows=42,498 width=0) (actual time=3.618..3.618 rows=42,809 loops=1)

12. 0.210 0.210 ↑ 4.0 1 70

Index Only Scan using index_campaign_place_groups_on_campaign_id_place_group_id on campaign_place_groups (cost=0.08..8.07 rows=4 width=8) (actual time=0.003..0.003 rows=1 loops=70)

  • Index Cond: (campaign_id = campaigns.id)
  • Heap Fetches: 72
13. 0.144 0.144 ↓ 0.0 0 72

Index Only Scan using index_place_group_places_on_place_id_and_place_group_id on place_group_places (cost=0.11..1.85 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=72)

  • Index Cond: ((place_id = 24106205) AND (place_group_id = campaign_place_groups.place_group_id))
  • Heap Fetches: 16
14. 0.080 0.080 ↓ 3.2 16 16

CTE Scan on place_timezone_info (cost=0.00..6.50 rows=5 width=556) (actual time=0.002..0.005 rows=16 loops=16)

  • Filter: (place_id = 24106205)
Planning time : 1.087 ms
Execution time : 4.959 ms