Intelligent Date Time Search in Mysql

We have created an audit table to records certain relevant actions taken by users of our application. The table has a primary key as well as a date/time stamp field to store when an action is taken. The interface that we use to view the audit table allows the user to select a date range.  Say All Results between March 28 - 29 , 2007.

Will Mysql search the entire table to find values with those dates or is it smart enough to look only between the dates selected? Or is there a way to make it look at the entries between the dates selected?

Can someone point me in the right direction to allow me to gain a better understanding of how Msql works in relation to a date/time search.

Who is Participating?
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
the keyword is indeed INDEXes. only with INDEXes on the relevant columns, you can improve search performance on the fields you put conditions on (WHERE, JOIN ... )
mukhtar2tConnect With a Mentor Commented:
You can index the date field so it will search just the selected period
You can check for documentaion of how date indexes work if you want
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.