explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UxOp

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

Limit (cost=11,621.48..11,626.48 rows=2,000 width=168) (actual time=18,490.096..18,490.523 rows=2,000 loops=1)

  • Buffers: shared hit=15,067,975 read=3,584
2. 600.435 18,490.336 ↑ 1.6 2,000 1

Sort (cost=11,621.48..11,629.66 rows=3,272 width=168) (actual time=18,490.094..18,490.336 rows=2,000 loops=1)

  • Sort Key: entry_log.entry_time DESC
  • Sort Method: top-N heapsort Memory: 757kB
  • Buffers: shared hit=15,067,975 read=3,584
3. 3,417.949 17,889.901 ↓ 318.4 1,041,657 1

Nested Loop Left Join (cost=12.70..11,430.46 rows=3,272 width=168) (actual time=1,649.032..17,889.901 rows=1,041,657 loops=1)

  • Buffers: shared hit=15,067,975 read=3,584
4. 503.491 11,346.981 ↓ 318.4 1,041,657 1

Nested Loop (cost=12.28..9,904.63 rows=3,272 width=109) (actual time=1,648.974..11,346.981 rows=1,041,657 loops=1)

  • Buffers: shared hit=11,024,087 read=3,584
5. 483.140 7,718.519 ↓ 318.4 1,041,657 1

Hash Join (cost=11.86..8,461.96 rows=3,272 width=91) (actual time=1,648.956..7,718.519 rows=1,041,657 loops=1)

  • Hash Cond: (member_plans.access_type = access_types.id)
  • Buffers: shared hit=6,856,444 read=3,584
6. 969.562 7,235.268 ↓ 105.8 1,529,165 1

Nested Loop (cost=0.85..8,412.71 rows=14,453 width=99) (actual time=0.123..7,235.268 rows=1,529,165 loops=1)

  • Buffers: shared hit=6,856,424 read=3,581
7. 383.772 1,669.640 ↓ 106.0 1,532,022 1

Nested Loop (cost=0.43..1,244.18 rows=14,453 width=63) (actual time=0.109..1,669.640 rows=1,532,022 loops=1)

  • Buffers: shared hit=738,841 read=3,490
8. 1.798 8.444 ↓ 144.0 144 1

Nested Loop (cost=0.00..40.88 rows=1 width=40) (actual time=0.040..8.444 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.869 3.371 ↓ 131.0 131 1

Nested Loop (cost=0.00..34.94 rows=1 width=30) (actual time=0.028..3.371 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.124 0.124 ↓ 106.0 106 1

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

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

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

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

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

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

Index Scan using entry_log_gym_access_point on entry_log (cost=0.43..914.24 rows=28,906 width=39) (actual time=0.008..8.871 rows=10,639 loops=144)

  • Index Cond: (gym_access_point = gym_access_points.id)
  • Buffers: shared hit=738,207 read=3,490
14. 4,596.066 4,596.066 ↑ 1.0 1 1,532,022

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,022)

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

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 14kB
  • Buffers: shared hit=20 read=3
16. 0.087 0.087 ↓ 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.037..0.087 rows=140 loops=1)

  • Index Cond: (company_id = 2)
  • Buffers: shared hit=20 read=3
17. 3,124.971 3,124.971 ↑ 1.0 1 1,041,657

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,657)

  • Index Cond: (id = member_plans.member_id)
  • Buffers: shared hit=4,167,643
18. 3,124.971 3,124.971 ↑ 1.0 1 1,041,657

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,657)

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