explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oGIa

Settings
# exclusive inclusive rows x rows loops node
1. 0.106 462.539 ↑ 2.3 329 1

Finalize GroupAggregate (cost=52,458.04..52,471.32 rows=759 width=16) (actual time=420.630..462.539 rows=329 loops=1)

  • Group Key: member_plans.original_plan
2. 0.136 462.433 ↑ 1.6 469 1

Sort (cost=52,458.04..52,459.94 rows=759 width=16) (actual time=420.626..462.433 rows=469 loops=1)

  • Sort Key: member_plans.original_plan
  • Sort Method: quicksort Memory: 46kB
3. 58.460 462.297 ↑ 1.6 469 1

Gather (cost=52,338.24..52,421.73 rows=759 width=16) (actual time=420.362..462.297 rows=469 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 2.056 403.837 ↑ 3.2 234 2 / 2

Partial HashAggregate (cost=51,338.24..51,345.83 rows=759 width=16) (actual time=403.785..403.837 rows=234 loops=2)

  • Group Key: member_plans.original_plan
5. 1.820 401.781 ↑ 1.3 8,122 2 / 2

Hash Join (cost=49.16..51,287.10 rows=10,228 width=16) (actual time=0.906..401.781 rows=8,122 loops=2)

  • Hash Cond: (plans.default_access_type = access_types.id)
6. 3.236 399.765 ↑ 1.3 8,122 2 / 2

Hash Join (cost=31.23..51,242.12 rows=10,228 width=24) (actual time=0.687..399.765 rows=8,122 loops=2)

  • Hash Cond: (member_plans.home_gym = gyms.id)
7. 4.127 396.417 ↑ 3.6 20,320 2 / 2

Merge Join (cost=0.71..51,012.48 rows=72,961 width=32) (actual time=0.565..396.417 rows=20,320 loops=2)

  • Merge Cond: (member_plans.original_plan = plans.id)
8. 391.303 391.303 ↑ 3.6 20,320 2 / 2

Parallel Index Scan using member_plans_original_plan on member_plans (cost=0.43..103,010.69 rows=72,961 width=24) (actual time=0.515..391.303 rows=20,320 loops=2)

  • Filter: ((renewal_of IS NULL) AND (membership_start <= CURRENT_DATE) AND ((membership_end >= CURRENT_DATE) OR autorenew_forever))
  • Rows Removed by Filter: 386,548
9. 0.987 0.987 ↑ 1.0 2,060 2 / 2

Index Scan using plans_pkey on plans (cost=0.28..81.86 rows=2,063 width=16) (actual time=0.036..0.987 rows=2,060 loops=2)

10. 0.010 0.112 ↑ 1.0 15 2 / 2

Hash (cost=30.34..30.34 rows=15 width=8) (actual time=0.111..0.112 rows=15 loops=2)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
11. 0.102 0.102 ↑ 1.0 15 2 / 2

Seq Scan on gyms (cost=0.00..30.34 rows=15 width=8) (actual time=0.022..0.102 rows=15 loops=2)

  • Filter: (company_id = 2)
  • Rows Removed by Filter: 92
12. 0.079 0.196 ↓ 1.1 565 2 / 2

Hash (cost=11.30..11.30 rows=530 width=8) (actual time=0.196..0.196 rows=565 loops=2)

  • Buckets: 1,024 Batches: 1 Memory Usage: 31kB
13. 0.117 0.117 ↓ 1.1 565 2 / 2

Seq Scan on access_types (cost=0.00..11.30 rows=530 width=8) (actual time=0.018..0.117 rows=565 loops=2)

Planning time : 0.846 ms
Execution time : 462.651 ms