explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sKJw

Settings
# exclusive inclusive rows x rows loops node
1. 0.199 18,577.848 ↑ 1.0 2,000 1

Limit (cost=11,668.23..11,673.23 rows=2,000 width=168) (actual time=18,577.396..18,577.848 rows=2,000 loops=1)

  • Buffers: shared hit=15,067,462 read=4,085
2. 574.789 18,577.649 ↑ 1.6 2,000 1

Sort (cost=11,668.23..11,676.45 rows=3,287 width=168) (actual time=18,577.395..18,577.649 rows=2,000 loops=1)

  • Sort Key: entry_log.entry_time DESC
  • Sort Method: top-N heapsort Memory: 757kB
  • Buffers: shared hit=15,067,462 read=4,085
3. 3,428.521 18,002.860 ↓ 316.9 1,041,656 1

Nested Loop Left Join (cost=12.70..11,476.23 rows=3,287 width=168) (actual time=1,635.857..18,002.860 rows=1,041,656 loops=1)

  • Buffers: shared hit=15,067,462 read=4,085
4. 530.253 11,449.371 ↓ 316.9 1,041,656 1

Nested Loop (cost=12.28..9,943.42 rows=3,287 width=109) (actual time=1,635.810..11,449.371 rows=1,041,656 loops=1)

  • Buffers: shared hit=11,023,579 read=4,084
5. 483.586 7,794.150 ↓ 316.9 1,041,656 1

Hash Join (cost=11.86..8,494.14 rows=3,287 width=91) (actual time=1,635.791..7,794.150 rows=1,041,656 loops=1)

  • Hash Cond: (member_plans.access_type = access_types.id)
  • Buffers: shared hit=6,855,940 read=4,084
6. 1,036.525 7,310.484 ↓ 105.3 1,529,164 1

Nested Loop (cost=0.85..8,444.72 rows=14,517 width=99) (actual time=0.066..7,310.484 rows=1,529,164 loops=1)

  • Buffers: shared hit=6,855,917 read=4,084
7. 390.133 1,677.896 ↓ 105.5 1,532,021 1

Nested Loop (cost=0.43..1,247.73 rows=14,517 width=63) (actual time=0.055..1,677.896 rows=1,532,021 loops=1)

  • Buffers: shared hit=738,299 read=4,032
8. 1.802 8.323 ↓ 144.0 144 1

Nested Loop (cost=0.00..40.88 rows=1 width=40) (actual time=0.036..8.323 rows=144 loops=1)

  • Join Filter: (gym_sections.id = gym_access_points.gym_section_id)
  • Rows Removed by Join Filter: 18,720
  • Buffers: shared hit=634
9. 1.898 3.508 ↓ 131.0 131 1

Nested Loop (cost=0.00..34.94 rows=1 width=30) (actual time=0.026..3.508 rows=131 loops=1)

  • Join Filter: (gym_sections.gym_id = gyms.id)
  • Rows Removed by Join Filter: 13,755
  • Buffers: shared hit=241
10. 0.126 0.126 ↓ 106.0 106 1

Seq Scan on gyms (cost=0.00..30.32 rows=1 width=22) (actual time=0.012..0.126 rows=106 loops=1)

  • Filter: (id = id)
  • Buffers: shared hit=29
11. 1.484 1.484 ↓ 1.1 131 106

Seq Scan on gym_sections (cost=0.00..3.16 rows=116 width=16) (actual time=0.002..0.014 rows=131 loops=106)

  • Buffers: shared hit=212
12. 3.013 3.013 ↓ 1.1 144 131

Seq Scan on gym_access_points (cost=0.00..4.31 rows=131 width=26) (actual time=0.002..0.023 rows=144 loops=131)

  • Buffers: shared hit=393
13. 1,279.440 1,279.440 ↑ 2.7 10,639 144

Index Scan using entry_log_gym_access_point on entry_log (cost=0.43..916.50 rows=29,035 width=39) (actual time=0.007..8.885 rows=10,639 loops=144)

  • Index Cond: (gym_access_point = gym_access_points.id)
  • Buffers: shared hit=737,665 read=4,032
14. 4,596.063 4,596.063 ↑ 1.0 1 1,532,021

Index Scan using member_plans_pkey on member_plans (cost=0.43..0.50 rows=1 width=52) (actual time=0.003..0.003 rows=1 loops=1,532,021)

  • Index Cond: (id = entry_log.member_plan_id)
  • Buffers: shared hit=6,117,618 read=52
15. 0.024 0.080 ↓ 1.2 140 1

Hash (cost=9.51..9.51 rows=120 width=8) (actual time=0.079..0.080 rows=140 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 14kB
  • Buffers: shared hit=23
16. 0.056 0.056 ↓ 1.2 140 1

Index Scan using access_type_company_id_name on access_types (cost=0.28..9.51 rows=120 width=8) (actual time=0.013..0.056 rows=140 loops=1)

  • Index Cond: (company_id = 2)
  • Buffers: shared hit=23
17. 3,124.968 3,124.968 ↑ 1.0 1 1,041,656

Index Scan using members_pkey on members (cost=0.42..0.44 rows=1 width=26) (actual time=0.003..0.003 rows=1 loops=1,041,656)

  • Index Cond: (id = member_plans.member_id)
  • Buffers: shared hit=4,167,639
18. 3,124.968 3,124.968 ↑ 1.0 1 1,041,656

Index Scan using access_tags_pkey on access_tags (cost=0.42..0.44 rows=1 width=17) (actual time=0.003..0.003 rows=1 loops=1,041,656)

  • Index Cond: (id = entry_log.access_tag_id)
  • Buffers: shared hit=4,043,883 read=1