explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0lKB

Settings
# exclusive inclusive rows x rows loops node
1. 105.168 565.076 ↓ 2.5 29,282 1

Sort (cost=37,648.11..37,677.32 rows=11,683 width=481) (actual time=560.041..565.076 rows=29,282 loops=1)

  • Sort Key: members.fname, members.sname
  • Sort Method: quicksort Memory: 14583kB
2. 52.481 459.908 ↓ 2.5 29,282 1

Hash Left Join (cost=3,272.52..36,858.80 rows=11,683 width=481) (actual time=34.765..459.908 rows=29,282 loops=1)

  • Hash Cond: (members.photo_id = files.id)
3. 23.506 386.866 ↓ 2.5 29,282 1

Hash Left Join (cost=1,224.27..34,312.56 rows=11,683 width=413) (actual time=14.026..386.866 rows=29,282 loops=1)

  • Hash Cond: (members.id = member_payment_details.member_id)
4. 28.253 349.505 ↓ 2.5 29,016 1

Nested Loop Left Join (cost=7.01..32,903.39 rows=11,683 width=344) (actual time=0.095..349.505 rows=29,016 loops=1)

5. 5.537 31.992 ↓ 2.3 24,105 1

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

6. 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.010..0.015 rows=1 loops=1)

  • Filter: (id = 2)
  • Rows Removed by Filter: 20
7. 19.150 26.440 ↓ 2.3 24,105 1

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

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

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

9. 0.029 0.049 ↑ 1.0 9 1

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

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

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

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

Index Scan using member_plans_member_id on member_plans (cost=0.42..2.95 rows=3 width=191) (actual time=0.007..0.012 rows=1 loops=24,105)

  • Index Cond: (members.id = member_id)
  • Filter: (renewal_of IS NULL)
  • Rows Removed by Filter: 15
12. 5.851 13.855 ↑ 1.0 22,499 1

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

  • Buckets: 32768 Batches: 1 Memory Usage: 2750kB
13. 8.004 8.004 ↑ 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.004 rows=22,499 loops=1)

  • Filter: (member_default IS TRUE)
  • Rows Removed by Filter: 3490
14. 10.652 20.561 ↓ 1.0 47,397 1

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

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

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

Planning time : 1.307 ms
Execution time : 567.786 ms