explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1R7E

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 524.035 ↑ 1.0 10 1

Limit (cost=148.42..1,846.39 rows=10 width=921) (actual time=520.840..524.035 rows=10 loops=1)

2. 274.348 524.032 ↑ 36,507.3 10 1

Nested Loop Left Join (cost=148.42..61,988,354.34 rows=365,073 width=921) (actual time=520.839..524.032 rows=10 loops=1)

3. 0.011 2.578 ↑ 36,507.3 10 1

Nested Loop Left Join (cost=53.93..20,135,388.21 rows=365,073 width=235) (actual time=0.444..2.578 rows=10 loops=1)

4. 0.016 0.257 ↑ 36,507.3 10 1

Nested Loop Left Join (cost=0.86..660,287.42 rows=365,073 width=203) (actual time=0.062..0.257 rows=10 loops=1)

5. 0.028 0.151 ↑ 35,371.0 10 1

Nested Loop Left Join (cost=0.43..440,451.83 rows=353,710 width=195) (actual time=0.048..0.151 rows=10 loops=1)

6. 0.043 0.043 ↑ 35,371.0 10 1

Seq Scan on collections_leads col_l (cost=0.00..75,164.50 rows=353,710 width=188) (actual time=0.030..0.043 rows=10 loops=1)

  • Filter: (is_lender_base = 0)
7. 0.080 0.080 ↑ 1.0 1 10

Index Scan using user_inputs__index_on_user_id on user_inputs lua (cost=0.43..1.02 rows=1 width=15) (actual time=0.008..0.008 rows=1 loops=10)

  • Index Cond: (user_id = col_l.user_id)
8. 0.090 0.090 ↑ 1.0 1 10

Index Scan using index_income_predict on income_predictions ip (cost=0.43..0.61 rows=1 width=12) (actual time=0.008..0.009 rows=1 loops=10)

  • Index Cond: (user_id = col_l.user_id)
9. 0.010 2.310 ↑ 1.0 1 10

Limit (cost=53.06..53.33 rows=1 width=40) (actual time=0.231..0.231 rows=1 loops=10)

10. 0.240 2.300 ↑ 3.0 1 10

Result (cost=53.06..53.85 rows=3 width=40) (actual time=0.230..0.230 rows=1 loops=10)

11. 0.050 2.060 ↑ 3.0 1 10

Sort (cost=53.06..53.07 rows=3 width=15) (actual time=0.206..0.206 rows=1 loops=10)

  • Sort Key: erir.id DESC
  • Sort Method: top-N heapsort Memory: 25kB
12. 0.283 2.010 ↓ 1.3 4 10

Nested Loop (cost=1.13..53.05 rows=3 width=15) (actual time=0.137..0.201 rows=4 loops=10)

13. 0.650 0.650 ↓ 2.4 36 10

Index Scan using idx_user_id_er on equifax_reports er (cost=0.57..14.20 rows=15 width=4) (actual time=0.011..0.065 rows=36 loops=10)

  • Index Cond: (user_id = col_l.user_id)
14. 1.077 1.077 ↓ 0.0 0 359

Index Scan using idx_report_id_erir on equifax_report_income_risk erir (cost=0.56..2.58 rows=1 width=23) (actual time=0.003..0.003 rows=0 loops=359)

  • Index Cond: (report_id = er.id)
15. 0.010 0.250 ↑ 1.0 1 10

Aggregate (cost=94.49..94.50 rows=1 width=17) (actual time=0.025..0.025 rows=1 loops=10)

16. 0.014 0.240 ↓ 0.0 0 10

Hash Join (cost=2.96..93.83 rows=38 width=17) (actual time=0.024..0.024 rows=0 loops=10)

  • Hash Cond: (ll.lead_log_type_id = llt.id)
17. 0.010 0.210 ↓ 0.0 0 10

Nested Loop Left Join (cost=1.42..91.83 rows=38 width=21) (actual time=0.021..0.021 rows=0 loops=10)

18. 0.010 0.200 ↓ 0.0 0 10

Nested Loop (cost=1.14..41.62 rows=38 width=16) (actual time=0.020..0.020 rows=0 loops=10)

19. 0.100 0.100 ↑ 1.0 1 10

Index Only Scan using leads_pkey on leads l (cost=0.56..2.58 rows=1 width=8) (actual time=0.009..0.010 rows=1 loops=10)

  • Index Cond: (id = col_l.lead_id)
  • Heap Fetches: 3
20. 0.090 0.090 ↓ 0.0 0 10

Index Scan using idx_lead_id_lead_logs on lead_logs ll (cost=0.57..38.65 rows=38 width=36) (actual time=0.009..0.009 rows=0 loops=10)

  • Index Cond: (lead_id = col_l.lead_id)
21. 0.000 0.000 ↓ 0.0 0

Index Scan using product_status_pkey on product_status ps (cost=0.28..1.32 rows=1 width=13) (never executed)

  • Index Cond: (ll.product_status_id = id)
22. 0.006 0.016 ↑ 1.0 24 1

Hash (cost=1.24..1.24 rows=24 width=4) (actual time=0.016..0.016 rows=24 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
23. 0.010 0.010 ↑ 1.0 24 1

Seq Scan on lead_log_types llt (cost=0.00..1.24 rows=24 width=4) (actual time=0.006..0.010 rows=24 loops=1)

24.          

SubPlan (for Nested Loop Left Join)

25. 0.010 0.530 ↑ 1.0 1 10

Limit (cost=17.08..17.08 rows=1 width=48) (actual time=0.053..0.053 rows=1 loops=10)

26. 0.040 0.520 ↑ 5.0 1 10

Sort (cost=17.08..17.09 rows=5 width=48) (actual time=0.052..0.052 rows=1 loops=10)

  • Sort Key: user_tokens.modified_ts DESC
  • Sort Method: quicksort Memory: 25kB
27. 0.480 0.480 ↑ 5.0 1 10

Index Scan using idx_user_id_user_tokens on user_tokens (cost=0.57..17.06 rows=5 width=48) (actual time=0.012..0.048 rows=1 loops=10)

  • Index Cond: (user_id = col_l.user_id)
  • Filter: (is_active = 1)
  • Rows Removed by Filter: 36
28. 0.000 0.000 ↓ 0.0 0

Index Only Scan using utm_source_log_composite_user_id_created_at_idx on utm_source_log (cost=0.57..2.59 rows=1 width=0) (never executed)

  • Index Cond: ((user_id = col_l.user_id) AND (created_at >= (CURRENT_DATE - '7 days'::interval)))
  • Heap Fetches: 0
29. 246.326 246.326 ↓ 1.1 853,752 1

Index Scan using idx_created_at_utm on utm_source_log utm_source_log_1 (cost=0.57..49,171.24 rows=766,283 width=8) (actual time=0.040..246.326 rows=853,752 loops=1)

  • Index Cond: (created_at >= (CURRENT_DATE - '7 days'::interval))
Planning time : 566.849 ms
Execution time : 524.601 ms