Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSQLMVCC and row versionsSingle-choice MCQ

Consider this PostgreSQL sequence. Why might the visible row count differ between the two SELECTs even with no other session committing in between?

BEGIN ISOLATION LEVEL READ COMMITTED; SELECT count(*) FROM orders; -- t1: returns 100 -- (another committed session here) SELECT count(*) FROM orders; -- t2: may return 101 COMMIT;