explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gteZ

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

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

2. 554.971 18,700.236 ↑ 1.6 2,000 1

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

  • Sort Key: entry_log.entry_time DESC
  • Sort Method: top-N heapsort Memory: 757kB
3. 3,493.434 18,145.265 ↓ 316.9 1,041,656 1

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

4. 545.453 11,526.863 ↓ 316.9 1,041,656 1

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

5. 481.497 7,856.442 ↓ 316.9 1,041,656 1

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

  • Hash Cond: (member_plans.access_type = access_types.id)
6. 1,099.603 7,374.802 ↓ 105.3 1,529,164 1

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

7. 380.005 1,679.136 ↓ 105.5 1,532,021 1

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

8. 1.495 7.883 ↓ 144.0 144 1

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

  • Join Filter: (gym_sections.id = gym_access_points.gym_section_id)
  • Rows Removed by Join Filter: 18,720
9. 1.729 3.244 ↓ 131.0 131 1

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

  • Join Filter: (gym_sections.gym_id = gyms.id)
  • Rows Removed by Join Filter: 13,755
10. 0.137 0.137 ↓ 106.0 106 1

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

  • Filter: (id = id)
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)

12. 3.144 3.144 ↓ 1.1 144 131

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

13. 1,291.248 1,291.248 ↑ 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.967 rows=10,639 loops=144)

  • Index Cond: (gym_access_point = gym_access_points.id)
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)
15. 0.032 0.143 ↓ 1.2 140 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 14kB
16. 0.111 0.111 ↓ 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.055..0.111 rows=140 loops=1)

  • Index Cond: (company_id = 2)
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)
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)