MySQL Forums
Forum List  »  Quality Assurance

SELECT LAST_INSERT_ID()
Posted by: Zoran Gvozdenovic
Date: November 10, 2016 03:23AM

Hello,

I have suggestion for you:

SELECT LAST_INSERT_ID() FROM table shouldn't go through the whole table.It takes a lot of time on a big table.
LAST_INSERT_ID() suggest that DESC(LAST_) is already implemented which is not.


So by default SELECT LAST_INSERT_ID() should be implemented as
SELECT LAST_INSERT_ID() FROM table ORDER By Id DESC LIMIT 1

Thanks.

Options: ReplyQuote


Subject
Views
Written By
Posted
SELECT LAST_INSERT_ID()
566
November 10, 2016 03:23AM


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.