Skip to main content
added 6 characters in body
Source Link

select max(id) is the most reliable way.

It's also quite fast if you have ana b-tree index on id (performance is virtually independent of the size of the table).

select max(id) is the most reliable way.

It's also quite fast if you have an index on id (performance is virtually independent of the size of the table).

select max(id) is the most reliable way.

It's also quite fast if you have a b-tree index on id (performance is virtually independent of the size of the table).

Post Made Community Wiki by Paul White
Originally left as a comment by https://dba.stackexchange.com/users/1822/a-horse-with-no-name (comment edited May 12, 2021 at 12:49)
Source Link

select max(id) is the most reliable way.

It's also quite fast if you have an index on id (performance is virtually independent of the size of the table).