explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jmAr

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 588.073 ↓ 4.3 29,282 1

Gather Merge (cost=24,937.34..25,727.62 rows=6,872 width=449) (actual time=474.343..588.073 rows=29,282 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
2. 164.640 925.246 ↓ 2.1 14,641 2

Sort (cost=23,937.33..23,954.51 rows=6,872 width=449) (actual time=459.149..462.623 rows=14,641 loops=2)

  • Sort Key: members.fname, members.sname
  • Sort Method: quicksort Memory: 8903kB
3. 41.438 760.606 ↓ 2.1 14,641 2

Hash Left Join (cost=3,273.81..23,499.36 rows=6,872 width=449) (actual time=74.040..380.303 rows=14,641 loops=2)

  • Hash Cond: (members.photo_id = files.id)
4. 17.194 627.472 ↓ 2.1 14,641 2

Nested Loop Left Join (cost=1,225.56..21,347.17 rows=6,872 width=405) (actual time=27.782..313.736 rows=14,641 loops=2)

5. 23.580 125.318 ↓ 2.0 12,124 2

Hash Left Join (cost=1,225.13..3,315.51 rows=6,058 width=238) (actual time=27.718..62.659 rows=12,124 loops=2)

  • Hash Cond: (members.id = member_payment_details.member_id)
6. 36.170 46.980 ↓ 2.0 12,052 2

Hash Join (cost=7.88..1,998.74 rows=6,058 width=169) (actual time=0.141..23.490 rows=12,052 loops=2)

  • Hash Cond: (members.crm_owner = crm_gyms.id)
7. 10.680 10.680 ↑ 1.2 21,960 2

Parallel Seq Scan on members (cost=0.00..1,834.76 rows=25,576 width=153) (actual time=0.016..5.340 rows=21,960 loops=2)

8. 0.026 0.130 ↑ 1.0 9 2

Hash (cost=7.76..7.76 rows=9 width=32) (actual time=0.065..0.065 rows=9 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.006 0.104 ↑ 1.0 9 2

Nested Loop (cost=0.00..7.76 rows=9 width=32) (actual time=0.029..0.052 rows=9 loops=2)

10. 0.040 0.040 ↑ 1.0 1 2

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

  • Filter: (id = 2)
  • Rows Removed by Filter: 20
11. 0.058 0.058 ↑ 1.0 9 2

Seq Scan on gyms crm_gyms (cost=0.00..6.47 rows=9 width=28) (actual time=0.010..0.029 rows=9 loops=2)

  • Filter: (company_id = 2)
  • Rows Removed by Filter: 29
12. 38.784 54.758 ↑ 1.0 22,499 2

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

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

Seq Scan on member_payment_details (cost=0.00..935.89 rows=22,509 width=77) (actual time=0.016..7.987 rows=22,499 loops=2)

  • Filter: (member_default IS TRUE)
  • Rows Removed by Filter: 3490
14. 484.960 484.960 ↑ 3.0 1 24,248

Index Scan using member_plans_member_id on member_plans (cost=0.42..2.95 rows=3 width=183) (actual time=0.012..0.020 rows=1 loops=24,248)

  • Index Cond: (members.id = member_id)
  • Filter: (renewal_of IS NULL)
  • Rows Removed by Filter: 15
15. 41.296 91.696 ↓ 1.0 47,397 2

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

  • Buckets: 65536 Batches: 1 Memory Usage: 4209kB
16. 50.400 50.400 ↓ 1.0 47,397 2

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

Planning time : 1.161 ms
Execution time : 589.725 ms