explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gZSc

Settings
# exclusive inclusive rows x rows loops node
1. 0.496 224.051 ↑ 1.0 2,000 1

Limit (cost=5.62..36,730.21 rows=2,000 width=168) (actual time=0.330..224.051 rows=2,000 loops=1)

  • Buffers: shared hit=33,107 read=82
2. 11.499 223.555 ↑ 7.5 2,000 1

Nested Loop Left Join (cost=5.62..275,770.59 rows=15,018 width=168) (actual time=0.329..223.555 rows=2,000 loops=1)

  • Buffers: shared hit=33,107 read=82
3. 1.238 204.056 ↑ 7.5 2,000 1

Nested Loop (cost=5.20..268,767.35 rows=15,018 width=109) (actual time=0.261..204.056 rows=2,000 loops=1)

  • Buffers: shared hit=25,179 read=82
4. 2.091 192.818 ↑ 7.5 2,000 1

Nested Loop (cost=4.79..262,145.70 rows=15,018 width=91) (actual time=0.247..192.818 rows=2,000 loops=1)

  • Buffers: shared hit=17,174 read=82
5. 1.747 188.727 ↑ 33.2 2,000 1

Nested Loop (cost=4.51..242,580.63 rows=66,329 width=99) (actual time=0.236..188.727 rows=2,000 loops=1)

  • Buffers: shared hit=11,174 read=82
6. 31.621 164.980 ↑ 33.2 2,000 1

Nested Loop (cost=4.08..209,697.16 rows=66,329 width=63) (actual time=0.214..164.980 rows=2,000 loops=1)

  • Join Filter: (gym_access_points.id = entry_log.gym_access_point)
  • Rows Removed by Join Filter: 138,529
  • Buffers: shared hit=3,173 read=82
7. 133.359 133.359 ↑ 54.8 28,106 1

Index Scan Backward using entry_log_entry_time_idx on entry_log (cost=0.43..71,190.59 rows=1,538,844 width=39) (actual time=0.078..133.359 rows=28,106 loops=1)

  • Buffers: shared hit=3,166 read=82
8. 0.000 0.000 ↑ 1.2 5 28,106

Materialize (cost=3.66..10.63 rows=6 width=40) (actual time=0.000..0.000 rows=5 loops=28,106)

  • Buffers: shared hit=7
9. 0.003 0.126 ↑ 1.2 5 1

Nested Loop (cost=3.66..10.60 rows=6 width=40) (actual time=0.080..0.126 rows=5 loops=1)

  • Buffers: shared hit=7
10. 0.021 0.021 ↑ 1.0 1 1

Index Scan using gyms_pkey on gyms (cost=0.14..2.36 rows=1 width=22) (actual time=0.019..0.021 rows=1 loops=1)

  • Index Cond: (id = 2)
  • Buffers: shared hit=2
11. 0.038 0.102 ↑ 1.2 5 1

Hash Join (cost=3.51..8.18 rows=6 width=26) (actual time=0.060..0.102 rows=5 loops=1)

  • Hash Cond: (gym_access_points.gym_section_id = gym_sections.id)
  • Buffers: shared hit=5
12. 0.037 0.037 ↓ 1.1 144 1

Seq Scan on gym_access_points (cost=0.00..4.31 rows=131 width=26) (actual time=0.011..0.037 rows=144 loops=1)

  • Buffers: shared hit=3
13. 0.004 0.027 ↑ 1.0 5 1

Hash (cost=3.45..3.45 rows=5 width=16) (actual time=0.026..0.027 rows=5 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=2
14. 0.023 0.023 ↑ 1.0 5 1

Seq Scan on gym_sections (cost=0.00..3.45 rows=5 width=16) (actual time=0.009..0.023 rows=5 loops=1)

  • Filter: (gym_id = 2)
  • Rows Removed by Filter: 126
  • Buffers: shared hit=2
15. 22.000 22.000 ↑ 1.0 1 2,000

Index Scan using member_plans_pkey on member_plans (cost=0.43..0.50 rows=1 width=52) (actual time=0.011..0.011 rows=1 loops=2,000)

  • Index Cond: (id = entry_log.member_plan_id)
  • Buffers: shared hit=8,001
16. 2.000 2.000 ↑ 1.0 1 2,000

Index Scan using access_types_pkey on access_types (cost=0.28..0.30 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=2,000)

  • Index Cond: (id = member_plans.access_type)
  • Filter: (company_id = 2)
  • Buffers: shared hit=6,000
17. 10.000 10.000 ↑ 1.0 1 2,000

Index Scan using members_pkey on members (cost=0.42..0.44 rows=1 width=26) (actual time=0.005..0.005 rows=1 loops=2,000)

  • Index Cond: (id = member_plans.member_id)
  • Buffers: shared hit=8,005
18. 8.000 8.000 ↑ 1.0 1 2,000

Index Scan using access_tags_pkey on access_tags (cost=0.42..0.44 rows=1 width=17) (actual time=0.004..0.004 rows=1 loops=2,000)

  • Index Cond: (id = entry_log.access_tag_id)
  • Buffers: shared hit=7,928
Planning time : 10.761 ms
Execution time : 224.762 ms