SQLite Forum

Is there a way to optimize this UPDATE command to run faster?
Login
Thank you for the reply.

In my table I have the following indexes:

 * Primary Key: (snapshot_id, object_id, param_id)
 * Normal: (snapshot_id, object_id)
 * Normal: (snapshot_id)

Please note that (snapshot_id, object_id) cannot be unique as a single object in a snapshot has ~200 parameters.

Another solution I considered is value-based:<br>
I found out that about 80% of our parameters are holding the value zero (the data is settings of audio knobs and controls, and the value zero is very popular). I considered the solution of not storing zero in the DB. It adds some logic mechanism but it is solve-able. This can significantly speed up operations done on [groups of] snapshots: merge, copy, paste, etc.