I have a query that is slowed down because of the following 3 OR clauses:
select * from book join library_member USING(book_id)
where member_id = 1145
and
( Date_add(Current_date(), interval 1 month) BETWEEN
book.check_in AND book.check_out )
OR ( Current_date() BETWEEN book.check_in AND
book.check_out )
OR ( book.check_out BETWEEN Current_date() AND Date_add(
Current_date(),
interval 1 month)
)
OR ( book.check_in BETWEEN
Current_date() AND Date_add(Current_date(), interval 1 month) )
Is there a better way of querying for either of these 4 scenarios?