explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bhVh

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Update on avail_update_details details (cost=27,489.71..30,486.71 rows=1 width=249) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Merge Join (cost=27,489.71..30,486.71 rows=1 width=249) (actual rows= loops=)

  • Merge Cond: ((maxdetail.date = details.date) AND (maxdetail.category_id = details.category_id) AND (maxdetail.category_ratetype_id = details.category_ratetype_id) AND (maxdetail.category_occupancy_id = details.category_occupancy_id) AND (maxdetail.board_indicative_id = details.board_indicative_id) AND (maxdetail.applyon = details.applyon))
  • Join Filter: (details.id <> maxdetail.maxid)
3. 0.000 0.000 ↓ 0.0

Subquery Scan on maxdetail (cost=11,928.35..13,561.90 rows=31,895 width=136) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=11,928.35..13,242.95 rows=31,895 width=56) (actual rows= loops=)

  • Group Key: maxdetail_1.date, maxdetail_1.building_id, maxdetail_1.category_id, maxdetail_1.category_ratetype_id, maxdetail_1.category_occupancy_id, maxdetail_1.board_indicative_id, maxdetail_1.applyon
5. 0.000 0.000 ↓ 0.0

Sort (cost=11,928.35..12,038.98 rows=44,251 width=56) (actual rows= loops=)

  • Sort Key: maxdetail_1.date, maxdetail_1.category_id, maxdetail_1.category_ratetype_id, maxdetail_1.category_occupancy_id, maxdetail_1.board_indicative_id, maxdetail_1.applyon
6. 0.000 0.000 ↓ 0.0

Index Scan using avail_update_details_outdated_index on avail_update_details maxdetail_1 (cost=0.42..8,513.63 rows=44,251 width=56) (actual rows= loops=)

  • Index Cond: (outdated = false)
  • Filter: ((NOT outdated) AND ((avail_update_type)::text = 'App\Models\AvailUpdate'::text) AND (building_id = 1) AND (salesclose = 0) AND (minimumstay = 0) AND (daysrelease = 0) AND (checkinallowed = 0))
7. 0.000 0.000 ↓ 0.0

Materialize (cost=15,561.35..15,782.61 rows=44,251 width=168) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Sort (cost=15,561.35..15,671.98 rows=44,251 width=168) (actual rows= loops=)

  • Sort Key: details.date, details.category_id, details.category_ratetype_id, details.category_occupancy_id, details.board_indicative_id, details.applyon
9. 0.000 0.000 ↓ 0.0

Index Scan using avail_update_details_outdated_index on avail_update_details details (cost=0.42..8,513.63 rows=44,251 width=168) (actual rows= loops=)

  • Index Cond: (outdated = false)
  • Filter: ((NOT outdated) AND ((avail_update_type)::text = 'App\Models\AvailUpdate'::text) AND (building_id = 1) AND (salesclose = 0) AND (minimumstay = 0) AND (daysrelease = 0) AND (checkinallowed = 0))