Optimize SQL that uses between clause

前端 未结 19 1938
故里飘歌
故里飘歌 2021-01-11 18:03

Consider the following 2 tables:

Table A:
id
event_time

Table B
id
start_time
end_time

Every record in table A is mapped to exactly 1 reco

19条回答
  •  北海茫月
    2021-01-11 18:30

    Is there an index on B (start_time, end_time)? If not, perhaps adding one might speed up the matching of B rows to A rows?

    Mind you, if you can't change the schema, maybe you can't create new indexes either?

提交回复
热议问题