Skip to content

Tag: sqlite

SQLite: optimize query with union

This is my table definition: And this is my query + plan: So the index is used, but there is still a scan and a b-tree involved in the order by. I tried getting rid of them by adding more indexes, but I don’t get it working. Any ideas of an index which gets rid of the scan? Answer Your

Condition to SUM previous values – SQLite

My following SQLite database: Explaining brazilian tax income: a) if I have loss, I don’t need to pay any tax (e.g.: January) b) negative results can be subtracted from the next month positive outcome (e.g.: in February, instead of paying the full tax for $ 5942, the tax can be applied only to (5942 &#8…