explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xeOm3

Settings
# exclusive inclusive rows x rows loops node
1. 97.861 353.726 ↓ 2.5 29,282 1

Sort (cost=28,137.01..28,166.16 rows=11,658 width=481) (actual time=349.058..353.726 rows=29,282 loops=1)

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

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

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

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

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

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

5. 4.778 29.841 ↓ 2.3 24,105 1

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

6. 0.018 0.018 ↑ 1.0 1 1

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

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

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

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

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

9. 0.005 0.023 ↑ 1.0 9 1

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

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

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

  • Filter: (company_id = 2)
  • Rows Removed by Filter: 29
11. 96.420 96.420 ↑ 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.004 rows=1 loops=24,105)

  • Index Cond: ((members.id = member_id) AND (renewal_of IS NULL))
12. 5.656 13.684 ↑ 1.0 22,499 1

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

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

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

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

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

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

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

Planning time : 1.575 ms
Execution time : 355.247 ms