Is there anything I can do to reduce the time taken?
> < Simon correctly advised >
> Do it in your favourite programming language rather than SQL.
Let me be even more clear :
Memory is cheap and most servers have plenty.
Processors are fast and most servers have multiple with many cores.
Select the entire table of columns you need into memory.
Write a little code.
No it won't scale very well into millions of rows but I could easily run
a test and I will bet many mnay many dollars that processing the sums in
memory is orders of magnitude faster than SQL.
ps: if your db is MySQL or Oracle db then the problem is trivial with
the C API
sqlite-users mailing list