explain.depesz.com

PostgreSQL's explain analyze made readable

Result: S5oId

Settings
# exclusive inclusive rows x rows loops node
1. 0.081 10.937 ↓ 98.0 98 1

Sort (cost=917.98..917.99 rows=1 width=213) (actual time=10.930..10.937 rows=98 loops=1)

  • Sort Key: p.company_id
  • Sort Method: quicksort Memory: 51kB
2. 0.054 10.856 ↓ 98.0 98 1

Nested Loop (cost=810.81..917.97 rows=1 width=213) (actual time=8.930..10.856 rows=98 loops=1)

3. 0.088 9.822 ↓ 98.0 98 1

Nested Loop (cost=810.53..902.02 rows=1 width=102) (actual time=8.908..9.822 rows=98 loops=1)

4. 0.061 8.894 ↓ 17.5 105 1

Sort (cost=810.26..810.27 rows=6 width=129) (actual time=8.886..8.894 rows=105 loops=1)

  • Sort Key: p.project_created_at DESC
  • Sort Method: quicksort Memory: 39kB
5. 0.485 8.833 ↓ 17.5 105 1

Nested Loop (cost=740.01..810.18 rows=6 width=129) (actual time=7.601..8.833 rows=105 loops=1)

6. 0.169 7.924 ↓ 17.7 106 1

Hash Right Join (cost=739.73..772.26 rows=6 width=129) (actual time=7.571..7.924 rows=106 loops=1)

  • Hash Cond: (s_phones.user_id = u.user_id)
7. 0.633 0.813 ↑ 1.0 1,347 1

HashAggregate (cost=40.26..53.95 rows=1,369 width=16) (actual time=0.608..0.813 rows=1,347 loops=1)

  • Group Key: s_phones.phone_value, s_phones.user_id
8. 0.180 0.180 ↑ 1.0 1,391 1

Seq Scan on s_phones (cost=0.00..33.17 rows=1,417 width=16) (actual time=0.005..0.180 rows=1,391 loops=1)

9. 0.049 6.942 ↓ 17.7 106 1

Hash (cost=699.40..699.40 rows=6 width=133) (actual time=6.942..6.942 rows=106 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
10. 0.043 6.893 ↓ 17.7 106 1

Nested Loop (cost=595.96..699.40 rows=6 width=133) (actual time=5.471..6.893 rows=106 loops=1)

11. 0.427 6.295 ↓ 18.5 111 1

Hash Join (cost=595.68..694.28 rows=6 width=111) (actual time=5.447..6.295 rows=111 loops=1)

  • Hash Cond: (uhp.project_id = p.project_id)
12. 0.431 0.431 ↓ 1.0 3,623 1

Seq Scan on s_user_has_project uhp (cost=0.00..85.03 rows=3,603 width=8) (actual time=0.003..0.431 rows=3,623 loops=1)

13. 0.044 5.437 ↓ 18.3 110 1

Hash (cost=595.60..595.60 rows=6 width=111) (actual time=5.437..5.437 rows=110 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 34kB
14. 5.393 5.393 ↓ 18.3 110 1

Seq Scan on s_projects p (cost=0.00..595.60 rows=6 width=111) (actual time=0.029..5.393 rows=110 loops=1)

  • Filter: ((((project_meta ->> 'plan_price'::text))::integer > 4) AND (((project_meta ->> 'resize_active'::text))::integer = 1))
  • Rows Removed by Filter: 3510
15. 0.555 0.555 ↑ 1.0 1 111

Index Scan using s_users_pkey on s_users u (cost=0.28..0.84 rows=1 width=26) (actual time=0.005..0.005 rows=1 loops=111)

  • Index Cond: (user_id = uhp.user_id)
  • Filter: ((user_email)::text !~~ ALL ('{%julian.dmk%,%scaleflex%,%cloudimg%}'::text[]))
  • Rows Removed by Filter: 0
16. 0.424 0.424 ↑ 1.0 1 106

Index Only Scan using cl_all_tokens_token_value_idx on cl_all_tokens clat (cost=0.28..6.30 rows=1 width=9) (actual time=0.004..0.004 rows=1 loops=106)

  • Index Cond: (token_value = (p.project_name)::text)
  • Heap Fetches: 35
17. 0.348 0.840 ↑ 1.0 1 105

Index Scan using s_stripe_tokens_company_id_idx on s_stripe_tokens s (cost=0.28..15.27 rows=1 width=31) (actual time=0.007..0.008 rows=1 loops=105)

  • Index Cond: (company_id = p.company_id)
  • Filter: (stripe_id = (SubPlan 1))
  • Rows Removed by Filter: 1
18.          

SubPlan (forIndex Scan)

19. 0.164 0.492 ↑ 1.0 1 164

Aggregate (cost=8.30..8.31 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=164)

20. 0.328 0.328 ↓ 2.0 2 164

Index Scan using s_stripe_tokens_company_id_idx on s_stripe_tokens (cost=0.28..8.29 rows=1 width=4) (actual time=0.001..0.002 rows=2 loops=164)

  • Index Cond: (company_id = s.company_id)
21. 0.338 0.980 ↑ 1.0 1 98

Index Scan using s_billing_company_id_idx on s_billing b (cost=0.28..15.94 rows=1 width=119) (actual time=0.008..0.010 rows=1 loops=98)

  • Index Cond: (company_id = p.company_id)
  • Filter: (billing_id = (SubPlan 2))
  • Rows Removed by Filter: 1
22.          

SubPlan (forIndex Scan)

23. 0.214 0.642 ↑ 1.0 1 214

Aggregate (cost=8.30..8.31 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=214)

24. 0.428 0.428 ↓ 3.0 3 214

Index Scan using s_billing_company_id_idx on s_billing (cost=0.28..8.29 rows=1 width=4) (actual time=0.001..0.002 rows=3 loops=214)

  • Index Cond: (company_id = b.company_id)