explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eCng

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

Update on avail_update_details details (cost=27,545.71..30,542.71 rows=1 width=241) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Merge Join (cost=27,545.71..30,542.71 rows=1 width=241) (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))
3. 0.000 0.000 ↓ 0.0

Subquery Scan on maxdetail (cost=11,956.35..13,589.90 rows=31,895 width=120) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=11,956.35..13,270.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,956.35..12,066.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,541.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,589.35..15,810.61 rows=44,251 width=168) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Sort (cost=15,589.35..15,699.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,541.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))