explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sfqc : Hold Resource Levels

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 0.170 ↑ 1.0 1 1

GroupAggregate (cost=49.83..62.91 rows=1 width=40) (actual time=0.170..0.170 rows=1 loops=1)

  • Group Key: resources.id, holds.id
2. 0.003 0.166 ↓ 6.0 6 1

Nested Loop (cost=49.83..62.89 rows=1 width=40) (actual time=0.164..0.166 rows=6 loops=1)

3. 0.002 0.039 ↑ 1.0 1 1

Nested Loop (cost=0.15..13.18 rows=1 width=20) (actual time=0.039..0.039 rows=1 loops=1)

  • Join Filter: (holds.organization_id = resources.organization_id)
4. 0.019 0.019 ↑ 1.0 1 1

Index Scan using holds_pkey on holds (cost=0.15..8.17 rows=1 width=16) (actual time=0.019..0.019 rows=1 loops=1)

  • Index Cond: (id = 1)
5. 0.018 0.018 ↑ 1.0 1 1

Seq Scan on resources (cost=0.00..5.00 rows=1 width=20) (actual time=0.018..0.018 rows=1 loops=1)

  • Filter: (id = 139)
  • Rows Removed by Filter: 31
6. 0.010 0.124 ↓ 6.0 6 1

Sort (cost=49.68..49.69 rows=1 width=52) (actual time=0.124..0.124 rows=6 loops=1)

  • Sort Key: ((days.day)::date)
  • Sort Method: quicksort Memory: 25kB
7. 0.007 0.114 ↓ 6.0 6 1

GroupAggregate (cost=49.64..49.67 rows=1 width=52) (actual time=0.111..0.114 rows=6 loops=1)

  • Group Key: holds_1.id, resources_1.id, days.day
8. 0.012 0.107 ↓ 7.0 7 1

Sort (cost=49.64..49.64 rows=1 width=32) (actual time=0.106..0.107 rows=7 loops=1)

  • Sort Key: days.day
  • Sort Method: quicksort Memory: 25kB
9. 0.007 0.095 ↓ 7.0 7 1

Nested Loop (cost=0.46..49.63 rows=1 width=32) (actual time=0.066..0.095 rows=7 loops=1)

  • Join Filter: ((days.day >= lap_holds.starts_on) AND (days.day <= lap_holds.ends_on))
  • Rows Removed by Join Filter: 11
10. 0.003 0.037 ↓ 3.0 3 1

Nested Loop (cost=0.30..16.37 rows=1 width=20) (actual time=0.033..0.037 rows=3 loops=1)

11. 0.019 0.019 ↓ 3.0 3 1

Index Scan using index_holdings_on_holdable_type_and_holdable_id on holdings (cost=0.15..8.17 rows=1 width=20) (actual time=0.018..0.019 rows=3 loops=1)

  • Index Cond: (((holdable_type)::text = 'Resource'::text) AND (holdable_id = 139))
12. 0.015 0.015 ↑ 1.0 1 3

Index Scan using holds_pkey on holds lap_holds (cost=0.15..8.17 rows=1 width=16) (actual time=0.005..0.005 rows=1 loops=3)

  • Index Cond: (id = holdings.hold_id)
13. 0.003 0.051 ↓ 1.2 6 3

Nested Loop (cost=0.16..33.19 rows=5 width=28) (actual time=0.016..0.017 rows=6 loops=3)

14. 0.006 0.030 ↑ 1.0 1 3

Nested Loop (cost=0.15..13.18 rows=1 width=28) (actual time=0.009..0.010 rows=1 loops=3)

  • Join Filter: (holds_1.organization_id = resources_1.organization_id)
15. 0.015 0.015 ↑ 1.0 1 3

Index Scan using holds_pkey on holds holds_1 (cost=0.15..8.17 rows=1 width=24) (actual time=0.005..0.005 rows=1 loops=3)

  • Index Cond: (id = 1)
16. 0.009 0.009 ↑ 1.0 1 3

Seq Scan on resources resources_1 (cost=0.00..5.00 rows=1 width=20) (actual time=0.003..0.003 rows=1 loops=3)

  • Filter: (id = 139)
  • Rows Removed by Filter: 31
17. 0.018 0.018 ↑ 166.7 6 3

Function Scan on generate_series days (cost=0.01..10.01 rows=1,000 width=8) (actual time=0.005..0.006 rows=6 loops=3)

Planning time : 1.010 ms
Execution time : 0.332 ms