I have a MySQL InnoDB table with about 1GB of records and growing. each record in this table has, among other fields two date fields :
- AddedDateRecord - The date the record was added (datetime).
- LastUpdatedRecord - The date the record was last updated (datetime).
The problem is that if i want to find all records relevant for a single date i have to use 3 "OR" statements. assuming "date" is the date I need :
- AddedDateRecord >= date:00:00:00 AND AddedDateRecord <= date:23:59:59
- LastUpdatedRecord >= date:00:00:00 AND LastUpdatedRecord <= date:23:59:59
- AddedDateRecord <= date:00:00:00 AND LastUpdatedRecord >= date:00:00:00
I'm sure you can see the performance hit for using these 3 ORs in a Query on a 1GB records table;
I'm looking for a solution that does not involve moving away from MySQL.
Any help would be greatly appreciated.