explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Fa62

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 5.0 65,220 1

HashAggregate (cost=50,454.16..50,618.04 rows=13,110 width=48) (actual rows=65,220 loops=1)

  • Group Key: days.day, a.id, COALESCE(r.id, a.id), COALESCE(c.formula, 'x'::character varying), NULLIF(COALESCE(r.id, a.id), a.id)
2. 0.000 0.000 ↓ 5.0 65,220 1

Nested Loop (cost=1,199.86..50,290.29 rows=13,110 width=48) (actual rows=65,220 loops=1)

3. 0.000 0.000 ↓ 5.0 65,220 1

Nested Loop (cost=1,199.43..38,503.17 rows=13,110 width=31) (actual rows=65,220 loops=1)

4. 0.000 0.000 ↓ 5.0 65,220 1

Hash Join (cost=1,199..3,794.45 rows=13,110 width=28) (actual rows=65,220 loops=1)

5. 0.000 0.000 ↓ 5.0 65,220 1

Hash Join (cost=1,163.36..3,689.96 rows=13,110 width=28) (actual rows=65,220 loops=1)

6. 0.000 0.000 ↓ 5.0 65,220 1

Nested Loop (cost=1.01..2,458.78 rows=13,110 width=28) (actual rows=65,220 loops=1)

7. 0.000 0.000 ↑ 1.0 30 1

Index Only Scan using days_pkey on days days (cost=0.29..9.41 rows=30 width=4) (actual rows=30 loops=1)

  • Index Cond: ((day >= ('now'::cstring)::date) AND (day <= (('now'::cstring)::date + '2 years -1 days'::interval)) AND (day >= '2020-09-01'::date) AND (day <= '2020-09-30'::date))
  • Heap Fetches: 30
8. 0.000 0.000 ↓ 5.0 2,174 30

Materialize (cost=0.71..2,286.59 rows=437 width=24) (actual rows=2,174 loops=30)

9. 0.000 0.000 ↓ 5.0 2,174 1

Nested Loop (cost=0.71..2,284.41 rows=437 width=24) (actual rows=2,174 loops=1)

10. 0.000 0.000 ↑ 44.0 1 1

Index Scan using rates_hotel_index on rates b (cost=0.29..72.5 rows=44 width=12) (actual rows=1 loops=1)

  • Index Cond: (hotel = 14,054)
  • Filter: enabled
11. 0.000 0.000 ↓ 135.9 2,174 1

Index Scan using roomrates_rate on roomrates a (cost=0.43..50.11 rows=16 width=16) (actual rows=2,174 loops=1)

  • Index Cond: (rate = b.id)
  • Filter: (hotel = 14,054)
12. 0.000 0.000 ↑ 1.0 38,214 1

Hash (cost=589.14..589.14 rows=38,214 width=12) (actual rows=38,214 loops=1)

13. 0.000 0.000 ↑ 1.0 38,214 1

Seq Scan on rulegroupsplanner h (cost=0..589.14 rows=38,214 width=12) (actual rows=38,214 loops=1)

14. 0.000 0.000 ↑ 1.0 42 1

Hash (cost=35.01..35.01 rows=42 width=12) (actual rows=42 loops=1)

15. 0.000 0.000 ↑ 1.0 42 1

Index Scan using rulegroups_hotel_index on rulegroups f (cost=0.29..35.01 rows=42 width=12) (actual rows=42 loops=1)

  • Index Cond: (hotel = 14,054)
16. 0.000 0.000 ↑ 1.0 1 65,220

Index Scan using rulegrouprooms_rulegroup_roomguest_key on rulegrouprooms c (cost=0.43..2.65 rows=1 width=19) (actual rows=1 loops=65,220)

  • Index Cond: ((rulegroup = f.id) AND (roomguest = a.roomguest))
17. 0.000 0.000 ↑ 2.0 1 65,220

Index Scan using roomrates_roomguest on roomrates r (cost=0.43..0.86 rows=2 width=16) (actual rows=1 loops=65,220)

  • Index Cond: (roomguest = c.roomguestref)
  • Filter: (hotel = 14,054)