explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 27eS

Settings
# exclusive inclusive rows x rows loops node
1. 82.945 458.660 ↓ 3.0 35,541 1

Hash Right Join (cost=24,964.02..26,790.50 rows=11,683 width=456) (actual time=368.192..458.660 rows=35,541 loops=1)

  • Hash Cond: (files.id = members.photo_id)
2. 7.713 7.713 ↓ 1.0 47,393 1

Seq Scan on files (cost=0.00..1,455.89 rows=47,389 width=44) (actual time=0.024..7.713 rows=47,393 loops=1)

3. 36.723 368.002 ↓ 3.0 35,541 1

Hash (cost=24,817.99..24,817.99 rows=11,683 width=405) (actual time=368.002..368.002 rows=35,541 loops=1)

  • Buckets: 65536 (originally 16384) Batches: 1 (originally 1) Memory Usage: 12264kB
4. 47.597 331.279 ↓ 3.0 35,541 1

Hash Right Join (cost=23,680.08..24,817.99 rows=11,683 width=405) (actual time=278.473..331.279 rows=35,541 loops=1)

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

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

6. 34.809 278.361 ↓ 2.5 29,282 1

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

  • Buckets: 32768 (originally 16384) Batches: 1 (originally 1) Memory Usage: 10132kB
7. 23.948 243.552 ↓ 2.5 29,282 1

Gather (cost=2,243.11..23,534.04 rows=11,683 width=413) (actual time=25.777..243.552 rows=29,282 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
8. 181.128 219.604 ↓ 2.1 14,641 2

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

9. 9.154 38.462 ↓ 2.0 12,124 2

Hash Left Join (cost=1,242.68..3,334.08 rows=6,058 width=238) (actual time=15.487..38.462 rows=12,124 loops=2)

  • Hash Cond: (members.id = member_payment_details.member_id)
10. 9.139 14.126 ↓ 2.0 12,052 2

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

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

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

12. 0.006 0.056 ↑ 1.0 9 2

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.004 0.050 ↑ 1.0 9 2

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

14. 0.018 0.018 ↑ 1.0 1 2

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

  • Filter: (id = 2)
  • Rows Removed by Filter: 20
15. 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.010..0.028 rows=9 loops=2)

  • Filter: (company_id = 2)
  • Rows Removed by Filter: 29
16. 7.219 15.182 ↑ 1.0 22,499 2

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

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

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

  • Filter: (member_default IS TRUE)
  • Rows Removed by Filter: 3490
18. 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.625 ms
Execution time : 463.148 ms