SQLite Forum

Shortcut to change a non changing update or upsert in a noop
Login
Can confirm, from reading discussions of this years ago.

Calls like <code>changes()</code> report the number of rows which satisfy the WHERE clause (and similar things which affect how many rows should be updated).  They are not influenced by existing values in fields to be overwritten.

In order to make things fast, various parts of SQLite act to minimise the actual work done to file storage.  They might be at the data level or the database page level, but you should not assume that file access is actually done (reading or writing).  As an example of this, SQLite might not even bother to read existing values from a table if they are stored in a convenient index.

If you want to know how many rows of the database would actually get different values, add that restriction to your WHERE clause.