Page 1 of 1

Timestamp VS smallint ORDER BY ...?

Posted: Thu Dec 12, 2002 11:44 am
by rxsid
Hi all,

would anyone out there know which situation would be most efficient in terms of less server processing time/resources?

i need a column in my table just for the purpose of doing an occasional ORDER BY either ASC or DESC.

would a timestamp(14) or (12) be better than say...a smallint with an autoincrement?

or is this a trivial question because they would require essentially the same processor resources and time? is there other "better" options??

thanks!

Posted: Thu Dec 12, 2002 12:08 pm
by kcomer
I am having problems getting MySQL to use indexes with a datetime field. I was thinking about changing it to an int field and seeing if it works better. This may help you decide which way to go. I'll let you know if I find anything out about the indexes on date fields.

Posted: Thu Dec 12, 2002 12:17 pm
by Johnm
kcomer,

I do not think that there will be much difference between the two but when it is all said and done... less is less. I would personally go with the auto increment int.

John M