Time difference for a query by changing one field?
Posted by: Goerge Meier
Date: November 13, 2018 10:28AM

Hello,
i do two querys overa database with 1.000.000 entries.
One is:
SELECT `id`, `Name`, `mtime`, `lat`, `lon`,ROUND(Speed,0) as Speed, `note` FROM DBLoc JOIN ( SELECT IMEI as i, Max(mtime) as d FROM DBLoc WHERE mtime >= date_sub(now(), interval 36 hour) OR Speed= -10 GROUP BY Name) AS QUERY2 ON Name= i AND mtime = d LIMIT 100

This one needs 2.3 seconds.

The same query but `mtime` ist changed to `date` (nearly same column style)
Same table etc. And this only takes 0.52 seconds.

Anybody an odea WHY this could be faster?
I am willed paying for ananswer. In this case contact me here. THANK YOU

Options: ReplyQuote


Subject
Written By
Posted
Time difference for a query by changing one field?
November 13, 2018 10:28AM


Sorry, only registered users may post in this forum.

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.