explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4yMC

Settings
# exclusive inclusive rows x rows loops node
1. 54.904 325.714 ↓ 3.0 35,541 1

Hash Right Join (cost=23,680.08..24,964.02 rows=11,683 width=412) (actual time=265.779..325.714 rows=35,541 loops=1)

  • Hash Cond: (access_tags.member_plan = member_plans.id)
2. 5.092 5.092 ↓ 1.0 42,708 1

Seq Scan on access_tags (cost=0.00..970.89 rows=42,689 width=8) (actual time=0.015..5.092 rows=42,708 loops=1)

3. 33.686 265.718 ↓ 2.5 29,282 1

Hash (cost=23,534.04..23,534.04 rows=11,683 width=405) (actual time=265.718..265.718 rows=29,282 loops=1)

  • Buckets: 32768 (originally 16384) Batches: 1 (originally 1) Memory Usage: 9950kB
4. 13.523 232.032 ↓ 2.5 29,282 1

Gather (cost=2,243.11..23,534.04 rows=11,683 width=405) (actual time=15.876..232.032 rows=29,282 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
5. 179.553 218.509 ↓ 2.1 14,641 2

Nested Loop Left Join (cost=1,243.11..21,365.74 rows=6,872 width=405) (actual time=15.504..218.509 rows=14,641 loops=2)

6. 9.276 38.942 ↓ 2.0 12,124 2

Hash Left Join (cost=1,242.68..3,334.08 rows=6,058 width=230) (actual time=15.437..38.942 rows=12,124 loops=2)

  • Hash Cond: (members.id = member_payment_details.member_id)
7. 9.538 14.608 ↓ 2.0 12,052 2

Hash Join (cost=7.88..1,998.74 rows=6,058 width=161) (actual time=0.181..14.608 rows=12,052 loops=2)

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

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

9. 0.010 0.112 ↑ 1.0 9 2

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.003 0.102 ↑ 1.0 9 2

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

11. 0.071 0.071 ↑ 1.0 1 2

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

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

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

  • Filter: (company_id = 2)
  • Rows Removed by Filter: 29
13. 7.064 15.058 ↑ 1.0 22,499 2

Hash (cost=944.32..944.32 rows=23,239 width=77) (actual time=15.058..15.058 rows=22,499 loops=2)

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

Seq Scan on member_payment_details (cost=0.00..944.32 rows=23,239 width=77) (actual time=0.019..7.994 rows=22,499 loops=2)

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

Index Scan using member_plans_member_id on member_plans (cost=0.42..2.95 rows=3 width=191) (actual time=0.008..0.014 rows=1 loops=24,248)

  • Index Cond: (members.id = member_id)
  • Filter: (renewal_of IS NULL)
  • Rows Removed by Filter: 15
Planning time : 1.172 ms
Execution time : 329.190 ms