Solved

Intelligent Date Time Search in Mysql

Posted on 2007-03-29
3
677 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 143

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AWS EC2 & RDS Instance 5 64
mysql db 3 85
CLI command keep running after close 7 56
MySQL - split column contents into 2 seperate columns 2 24
I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

730 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