// sqlite · sql behavior

read_uncommitted

Allow this connection to read rows other connections have changed but not committed.

Default
0 (off)
Range
0, 1
Restart needed
No
Default checked on
SQLite 3.5x

What it does

SQLite's default isolation is SERIALIZABLE. READ UNCOMMITTED only takes effect between connections that share a page and schema cache; cache sharing is off by default and enabled per process with sqlite3_enable_shared_cache(). Without shared cache this pragma changes nothing.

Default value

0 (off). Off (a stock SQLite 3.5x build); the shared-cache mode it depends on is off by default too.

Check the current value

PRAGMA read_uncommitted;

SELECT * FROM pragma_read_uncommitted;   -- table-valued form, usable in queries

Change it

PRAGMA read_uncommitted = ON;   -- this connection only

No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.

When to change it

In shared-cache applications that deliberately trade isolation for fewer lock conflicts between threads of one process. Outside shared-cache mode, leave it alone.

What can go wrong

With it on, a connection can read rows the writer rolls back moments later, so totals and joins can mix committed and abandoned data. Outside shared-cache mode the pragma silently does nothing, which misleads people who set it expecting looser isolation.

Questions about read_uncommitted

What is the default value of read_uncommitted in SQLite?

0 (off). Off (a stock SQLite 3.5x build); the shared-cache mode it depends on is off by default too.

Does changing read_uncommitted require a restart?

No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.

When should I change read_uncommitted?

In shared-cache applications that deliberately trade isolation for fewer lock conflicts between threads of one process. Outside shared-cache mode, leave it alone.

Back to all SQLite settings, or check the SQLite manual for every option.

// one client for every engine

Check read_uncommitted on your own server

SQLly runs the query above against SQLite and the other engines in this reference, from one desktop app on macOS, Windows and Linux.

Text and data on this page: CC BY 4.0, credit SQLly (sqlly.app). Code and SQL snippets: MIT. License details View as Markdown