On Wednesday, 2 January, 2019 03:06, Dominique Devienne <ddevie...@gmail.com> 
wrote:

>On Mon, Dec 31, 2018 at 10:31 PM Keith Medcalf <kmedc...@dessus.com> wrote:

>>> I don't think the interrupt call will actually terminate a step
>>> that is actually being processed, but only mark that no more steps
>>> should happen. In other words, I don't think SQLite is spending time
>>> checking a flag to stop in the middle of processing a step to
>>> allow the processing to terminate early without a result.

>> Actually it does.  The callback and the interrupt flags are checked
>> at the bottom of each loop.  I haven't looked through the source to see if
>> the sorter is interruptible or not though ... and the Vdbe halt code
>> will "clean up" from the interruption (as if it were an error).

> I was thinking exactly the same thing Keith, i.e. whether sorts are
> also "interruptible".

A quick look at the source and I think they are not.  It appears that the check 
for whether the interrupt is set on the connection object occurs in the VDBE 
execution only at the bottom of loops (since all queries are processed as 
nested loops this should occur pretty frequently).  This includes the bottom of 
the loop reading from a sorter.  

>And whether the answer changes between the "regular" and "parallel"
>sorts.

I wouldn't think so since there are no references to db->isInterrupted within 
the sort code ... on the other hand, I am not certain that the sorter is not 
somewhat incremental.  That is, if you run nested loops generating input to the 
sorter, the process is interruptible during the generation of data into a  
sorter and also when the data comes out of that sorter.  However after the last 
record goes into the sorter and before the first (or next) record comes out of 
that sorter, the process does not appear to be interruptible.

I am sure Richard will correct me if I missed something here.

However, a WAL checkpoint is interruptible while copying pages from the WAL to 
the database.

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.




_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to