Given a table structure like this:
ID|Measurement|Diff|Date
where ID is the primary key, and rows are indexed by the Date column.
I want to use a trigger (after an insert or replace into) to calculate the Diff column for the table. The Diff column simply records the differences in the values of Measurement between two adjacent dates for the same ID.
What is the optimal way of doing this in SQLite? Performance is crucial here, since the table is large, i.e. 1M+ rows.
Aucun commentaire:
Enregistrer un commentaire