explain.depesz.com

PostgreSQL's explain analyze made readable

Result: s7qa

Settings
# exclusive inclusive rows x rows loops node
1. 48.420 253.016 ↓ 2.5 29,282 1

Hash Left Join (cost=3,272.52..27,349.57 rows=11,658 width=481) (actual time=36.232..253.016 rows=29,282 loops=1)

  • Hash Cond: (members.photo_id = files.id)
2. 21.892 183.010 ↓ 2.5 29,282 1

Hash Left Join (cost=1,224.27..24,804.39 rows=11,658 width=413) (actual time=14.456..183.010 rows=29,282 loops=1)

  • Hash Cond: (members.id = member_payment_details.member_id)
3. 43.304 146.809 ↓ 2.5 29,016 1

Nested Loop Left Join (cost=7.01..23,395.64 rows=11,658 width=344) (actual time=0.074..146.809 rows=29,016 loops=1)

4. 5.735 31.190 ↓ 2.3 24,105 1

Nested Loop (cost=6.59..2,251.35 rows=10,298 width=169) (actual time=0.056..31.190 rows=24,105 loops=1)

5. 0.015 0.015 ↑ 1.0 1 1

Seq Scan on companies crm_companies (cost=0.00..1.20 rows=1 width=20) (actual time=0.011..0.015 rows=1 loops=1)

  • Filter: (id = 2)
  • Rows Removed by Filter: 20
6. 17.981 25.440 ↓ 2.3 24,105 1

Hash Join (cost=6.59..2,147.17 rows=10,298 width=165) (actual time=0.044..25.440 rows=24,105 loops=1)

  • Hash Cond: (members.crm_owner = crm_gyms.id)
7. 7.432 7.432 ↓ 1.0 43,920 1

Seq Scan on members (cost=0.00..2,013.80 rows=43,480 width=153) (actual time=0.007..7.432 rows=43,920 loops=1)

8. 0.005 0.027 ↑ 1.0 9 1

Hash (cost=6.47..6.47 rows=9 width=28) (actual time=0.027..0.027 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.022 0.022 ↑ 1.0 9 1

Seq Scan on gyms crm_gyms (cost=0.00..6.47 rows=9 width=28) (actual time=0.004..0.022 rows=9 loops=1)

  • Filter: (company_id = 2)
  • Rows Removed by Filter: 29
10. 72.315 72.315 ↑ 3.0 1 24,105

Index Scan using member_plans_member_id_renewal_of on member_plans (cost=0.42..2.02 rows=3 width=191) (actual time=0.003..0.003 rows=1 loops=24,105)

  • Index Cond: ((members.id = member_id) AND (renewal_of IS NULL))
11. 5.684 14.309 ↑ 1.0 22,499 1

Hash (cost=935.89..935.89 rows=22,509 width=77) (actual time=14.309..14.309 rows=22,499 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 2750kB
12. 8.625 8.625 ↑ 1.0 22,499 1

Seq Scan on member_payment_details (cost=0.00..935.89 rows=22,509 width=77) (actual time=0.004..8.625 rows=22,499 loops=1)

  • Filter: (member_default IS TRUE)
  • Rows Removed by Filter: 3490
13. 11.038 21.586 ↓ 1.0 47,397 1

Hash (cost=1,455.89..1,455.89 rows=47,389 width=44) (actual time=21.586..21.586 rows=47,397 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 4209kB
14. 10.548 10.548 ↓ 1.0 47,397 1

Seq Scan on files (cost=0.00..1,455.89 rows=47,389 width=44) (actual time=0.013..10.548 rows=47,397 loops=1)

Planning time : 1.302 ms
Execution time : 255.186 ms