Re: What is faster: from_unixtime() or unix_timestamp()?
A guess, mysql is converting into mysql datetime format, and it seems more efficient to convert from a date time string than converting from a unix timestamp value.
From mysql internals document
DATETIME
Storage: eight bytes.
Part 1 is a 32-bit integer containing year*10000 + month*100 + day.
Part 2 is a 32-bit integer containing hour*10000 + minute*100 + second.
Another test
select benchmark(1000000, 1128719129 > unix_timestamp(now()));
Looks like unix_timestamp() is faster than from_unixtime().
Subject
Views
Written By
Posted
3313
October 07, 2005 03:17PM
1736
October 08, 2005 10:36AM
1469
October 08, 2005 01:55PM
Re: What is faster: from_unixtime() or unix_timestamp()?
1866
October 09, 2005 09:53AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.