Creating an index on a timestamp to optimize query

前端 未结 4 657
别跟我提以往
别跟我提以往 2020-12-13 03:41

I have a query of the following form:

SELECT * FROM MyTable WHERE Timestamp > [SomeTime] AND Timestamp < [SomeOtherTime]

I would like

4条回答
  •  伪装坚强ぢ
    2020-12-13 03:52

    No question about it. Without the index, your query has to look at every row in the table. With the index, the query will be pretty much instantaneous as far as locating the right rows goes. The price you'll pay is a slight performance decrease in inserts; but that really will be slight.

提交回复
热议问题