What is faster: from_unixtime() or unix_timestamp()?
Can some please give a hint:
For examle, I have some file timestamp. And now I want to compare it with some datetme column in the table (in the examle below I will compare with now()). So I wonder, what is faster:
1) Pass a timestamp as number:
select case when from_unixtime(1128719129) > now() then 1 else 0 end;
2) Perform a query:
select unix_timestamp();
and then compare with timestamp in the high-level application
3) Pass a timestamp as a string:
select case when '2005-10-08 00:10:10' > now() then 1 else 0 end;
I guess, the first one should be faster, as aviods multiple strings parsing?
Thanks.
Subject
Views
Written By
Posted
What is faster: from_unixtime() or unix_timestamp()?
3324
October 07, 2005 03:17PM
1742
October 08, 2005 10:36AM
1473
October 08, 2005 01:55PM
1871
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.