写出以下查询的更好/更有效的方法是什么?
当前的 SQL 查询可以很好地完成它的工作,但我担心随着数据库变得更大的处理时间。
SELECT *
FROM room
JOIN catering ON room.room_id = catering.room_id
WHERE capacity BETWEEN '$minCapacity' AND '$maxCapacity'
AND room.room_id NOT IN
(SELECT room_id
FROM room_booking
WHERE date_booked = '$us_date')
AND catering.grade = '$grade' ORDER BY room.capacity