MySQL 8.0.15 INNODB table Dead slow query
I was trying to query a innodb table where i am trying to fetch the last record entry and row, but the query is taking 15.14 sec to complete.
the table contains 400,000 records.
here is my query
-- loconumber is a indexed column
-- journeyserla is a autonumber primary key int(11)
with LocomotiveLastRun AS(
SELECT locojourney.loconumber , MAX(locojourney.journeyserla) as lastrunid
from locojourney GROUP BY loconumber)
SELECT locojourney.CurrentCombiners , locojourney.JourneySerla ,
locojourney.From_RunPoint , locojourney.NEXT_RunPoint
FROM
LocomotiveLastRun FORCE INDEX(lastrunid) JOIN
locojourney FORCE INDEX(PRIMARY) ON x.lastrunid = locojourney.journeyserla
WHERE locojourney.ishoc = 'n'
Subject
Views
Written By
Posted
MySQL 8.0.15 INNODB table Dead slow query
1381
March 30, 2019 10:05AM
493
March 30, 2019 10:00PM
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.