Timestamp VS smallint ORDER BY ...?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rxsid
Forum Commoner
Posts: 82
Joined: Thu Aug 29, 2002 12:04 am

Timestamp VS smallint ORDER BY ...?

Post 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!
kcomer
Forum Contributor
Posts: 108
Joined: Tue Aug 27, 2002 8:50 am

Post 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.
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post 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
Post Reply