Solved

Intelligent Date Time Search in Mysql

Posted on 2007-03-29
3
675 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Creating and Managing Databases with phpMyAdmin in cPanel.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now