# cell_size_check

> Run extra sanity checks on b-tree pages as they are read from disk.

Source: https://sqlly.app/sql-configuration/sqlite/cell-size-check
Last updated: 2026-11-30
License: Text and data [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (credit SQLly, sqlly.app); code and SQL snippets [MIT](https://opensource.org/license/mit). [Details](https://sqlly.app/license).

**Default**

`0 (off)`

**Range**

0, 1

**Restart needed**

No

**Default checked on**

SQLite 3.5x

## What it does

Corruption is detected when the page is first read and is less likely to spread through the file, at a small CPU cost per page. Off by default because the extra checks run on every read.

## Default value

`0 (off)`. Off (a stock SQLite 3.5x build).

## Check the current value

```
PRAGMA cell_size_check;

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

## Change it

```
PRAGMA cell_size_check = 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

On databases where corruption has appeared before or the storage is not fully trusted, such as removable media, and while an integrity_check investigation is under way.

## What can go wrong

The checks run on every page read for the connection's whole lifetime, so a read-heavy workload pays the CPU cost continuously; a caught bad page also turns silent reads of damaged rows into visible errors.

## Questions about cell_size_check

### What is the default value of cell_size_check in SQLite?

0 (off). Off (a stock SQLite 3.5x build).

### Does changing cell_size_check 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 cell_size_check?

On databases where corruption has appeared before or the storage is not fully trusted, such as removable media, and while an integrity_check investigation is under way.

Back to all [SQLite settings](https://sqlly.app/sql-configuration/sqlite), or check the [SQLite manual](https://www.sqlite.org/pragma.html) for every option.

## Related SQLite settings

- [`journal_mode` How SQLite keeps transactions atomic: a rollback journal or a write-ahead log (WAL).](https://sqlly.app/sql-configuration/sqlite/journal-mode)
- [`synchronous` How often SQLite waits for data to reach the disk (fsync).](https://sqlly.app/sql-configuration/sqlite/synchronous)
- [`secure_delete` Overwrite deleted content with zeros.](https://sqlly.app/sql-configuration/sqlite/secure-delete)

## Related on SQLly

- [When a fast query turns slow Performance guide](https://sqlly.app/sql-performance/sudden-slowdown)
- [SQLite query performance troubleshooting Performance guide](https://sqlly.app/sql-performance/sqlite)
