Solved

Intelligent Date Time Search in Mysql

Posted on 2007-03-29
3
676 Views
Last Modified: 2010-08-05
Scenario:
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.

Question:
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.

Thanks
0
Comment
Question by:winbiz
  • 2
3 Comments
 
LVL 4

Assisted Solution

by:mukhtar2t
mukhtar2t earned 200 total points
ID: 18816302
You can index the date field so it will search just the selected period
0
 
LVL 4

Expert Comment

by:mukhtar2t
ID: 18816316
You can check http://mysql.com for documentaion of how date indexes work if you want
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 300 total points
ID: 18817488
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 ... )
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikipedia.org/wiki/PHP  Very powerful.  But a…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question