Select last date check all rows
Hey,
I have some slow query issues where i do something like :
SELECT x FROM y WHERE datefield < NOW() order by datefield DESC LIMIT 1
The result from EXPLAIN XXX shows that the row count is 100k+
Shouldnt it be able to just fetch the latest row if datefield is an index?
The table holds like 150k rows, and it takes about 5-6 sec to execute such as query.
Subject
Views
Written By
Posted
Select last date check all rows
1589
August 04, 2015 08:47AM
750
August 05, 2015 05:49PM
869
August 06, 2015 03:11AM
650
August 06, 2015 03:13AM
696
August 06, 2015 10:36PM
850
August 07, 2015 04:12AM
750
August 08, 2015 11:11AM
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.