explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jmAr

Settings
# exclusive inclusive rows x rows loops node
1. 125.450 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. 82.320 462.623 ↓ 2.1 14,641 2 / 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. 20.719 380.303 ↓ 2.1 14,641 2 / 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. 8.597 313.736 ↓ 2.1 14,641 2 / 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. 11.790 62.659 ↓ 2.0 12,124 2 / 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. 18.085 23.490 ↓ 2.0 12,052 2 / 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. 5.340 5.340 ↑ 1.2 21,960 2 / 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.013 0.065 ↑ 1.0 9 2 / 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.003 0.052 ↑ 1.0 9 2 / 2

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

10. 0.020 0.020 ↑ 1.0 1 2 / 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.029 0.029 ↑ 1.0 9 2 / 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. 19.392 27.379 ↑ 1.0 22,499 2 / 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. 7.987 7.987 ↑ 1.0 22,499 2 / 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. 242.480 242.480 ↑ 3.0 1 24,248 / 2

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. 20.648 45.848 ↓ 1.0 47,397 2 / 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. 25.200 25.200 ↓ 1.0 47,397 2 / 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