Predictable Results With LIMIT Or FETCH FIRST Require ORDER BY
if you want predictable results with LIMIT or FETCH FIRST in PostgreSQL, use ORDER BY to ensure consistent output order. Without ORDER BY, concurrent sequential scans can lead to unpredictable results.
TL;DR: if you want predictable results with LIMIT or FETCH FIRST in any database, you need an ORDER BY. Here is a quick blog post to explain the following observation where running the same query provides different results even when the table is not changing: // Detect dark theme var iframe = document.getElementById('tweet-1881281403528343815-830'); if (document.body.className.includes('dark-theme')) { iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1881281403528343815&theme=dark" } I've set the Repeatable Read isolation level and locked the table in exclusive m...