explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YbDB

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 20,710.289 ↓ 0.0 0 1

Update on avail_update_details details (cost=958,498.00..1,021,054.46 rows=1 width=214) (actual time=20,710.289..20,710.289 rows=0 loops=1)

2. 44.876 20,710.286 ↓ 0.0 0 1

Merge Join (cost=958,498.00..1,021,054.46 rows=1 width=214) (actual time=20,710.286..20,710.286 rows=0 loops=1)

  • Merge Cond: ((details.date = maxdetail.date) AND (details.building_id = maxdetail.building_id) AND (details.category_id = maxdetail.category_id) AND (details.category_ratetype_id = maxdetail.category_ratetype_id) AND (details.category_occupancy_id = maxdetail.category_occupancy_id) AND (details.board_indicative_id = maxdetail.board_indicative_id) AND (details.applyon = maxdetail.applyon))
  • Join Filter: (details.id <> maxdetail.maxid)
  • Rows Removed by Join Filter: 27968
3. 91.933 10,113.459 ↑ 32.7 27,968 1

Sort (cost=507,364.50..509,649.53 rows=914,011 width=129) (actual time=10,094.907..10,113.459 rows=27,968 loops=1)

  • Sort Key: details.date, details.building_id, details.category_id, details.category_ratetype_id, details.category_occupancy_id, details.board_indicative_id, details.applyon
  • Sort Method: external merge Disk: 3296kB
4. 10,021.526 10,021.526 ↑ 32.7 27,968 1

Seq Scan on avail_update_details details (cost=0.00..291,904.95 rows=914,011 width=129) (actual time=2,567.392..10,021.526 rows=27,968 loops=1)

  • Filter: ((NOT outdated) AND (record_type = 5) AND (property_id = 1))
  • Rows Removed by Filter: 6838725
5. 29.278 10,551.951 ↑ 19.2 27,968 1

Materialize (cost=451,133.50..486,035.88 rows=535,649 width=144) (actual time=10,438.316..10,551.951 rows=27,968 loops=1)

6. 32.622 10,522.673 ↑ 19.2 27,968 1

Subquery Scan on maxdetail (cost=451,133.50..484,696.75 rows=535,649 width=144) (actual time=10,438.310..10,522.673 rows=27,968 loops=1)

7. 36.346 10,490.051 ↑ 19.2 27,968 1

GroupAggregate (cost=451,133.50..479,340.26 rows=535,649 width=60) (actual time=10,438.298..10,490.051 rows=27,968 loops=1)

  • 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, maxdetail_1.record_type
8. 46.141 10,453.705 ↑ 32.7 27,968 1

Sort (cost=451,133.50..453,418.53 rows=914,011 width=60) (actual time=10,438.280..10,453.705 rows=27,968 loops=1)

  • Sort 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
  • Sort Method: external merge Disk: 2032kB
9. 10,407.564 10,407.564 ↑ 32.7 27,968 1

Seq Scan on avail_update_details maxdetail_1 (cost=0.00..291,904.95 rows=914,011 width=60) (actual time=6,650.457..10,407.564 rows=27,968 loops=1)

  • Filter: ((NOT outdated) AND (record_type = 5) AND (property_id = 1))
  • Rows Removed by Filter: 6838725
Planning time : 0.495 ms
Execution time : 20,712.917 ms