I am trying to make use of SQLite's multi-threading capabilities to create a
temporary table  from a query .    Currently, I have not had enough time to
wait for SQLite to create the temporary table ( I tried for over 2
hours) , but I
can see from the /proc/${pid}/task listing for the sqlite3 $pid that only one
thread is being used, despite having compiled the sqlite3-3.8.9 instance with:
 ...  -DSQLITE_THREADSAFE=1 -DSQLITE_DEFAULT_WORKER_THREADS=4
      -DSQLITE_MAX_WORKER_THREADS=8 ... -mtune=native -O3 -fPIC -g -pipe

My question is simply how to get sqlite3 to use multiple threads to create the
temporary table from a query,  which is computing minima, averages and maxima
over about 2 million floating point measurements that correspond to a
set of "GROUP BY" selectors, and then back-tracking to count how many
measurements M with the same
selectors  fall into one of 4 "quartiles" :
   1:  min(M) to Q1: ( min(M) + (  (max(M) - min(M) ) /4 )
   2:  Q1  to      Q2: ( min(M) + ( (max(M) - min(M) ) /2 ) )
   3:  Q2  to      Q3: ( min(M) + ( (max(M) - min(M) ) * 1.75) )
   4:  Q3  to max(M)
(the goal is eventually to plot these measurements to show the rough
distribution
 of measurements between the maximum and minimum along with the average on
 the same plot).
So first I construct a view that calculates the min(M) , avg(M),
max(M),  and Q1, Q2 and Q3 values, then I construct a view that counts
how many measurements fall into each quartile .
But this seems to be effectively a non-terminating process - it is
taking way to long to be useful ( it takes around 30 seconds to
compute an output result line, and there are
around 30,000 such result lines ).
Any ideas about how to get SQLite to use the multiple threads I have configured
in its computation of the temporary table ?
Thanks in advance for any replies.
Regards, Jason.

Reply via email to