SQLite Forum

Are result values always the same?
Login
Keith and Wout, thanks for the suggestions. The field pl_id is a primary key (and thus unique). However, the table is tiny. There will never be more than a handful of rows in it and most times just one or two. (It's the list of folders in which there are playlists that the user might want to play.)

So, given that it's tiny, that means that every update will cause the whole table to be written for every update. If the index you suggest exists, is it in the same physical record as the table? If it's in a separate record, then there is more I/O.

Just for interest, knowing that I/O is going to happen to ensure commit integrity, and that the table will fit in one record, what is the sequence of I/O operations to accomplish these queries, and is there any way to minimize the number of them?
```
update pltable set checkbox = (case when pl_id == ?1 then 1 else 0 end)
where pl_id == ?1 or checkbox == 1;
```
and this one:
```
update pltable set checkbox = (case when pl_id == ?1 then 1 else 0 end);
```