All,

I was reading in my SQL book about optimizing queries, and it came to me that MySQL date fields may not be the way to go.

For example, if you have "year(date_col) = 1990" in your where clause, MySQL will not use an index because it must calculate year for each date_col value.

Now, since I almost never use MySQL without PHP, I've tended to store an int generated from mktime() for dates and do all my calulations on the PHP side. Which way do you prefer and why?

Regards,

Jeremy

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



____________________
BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to