Sent from my iPad

On 10 sep. 2013, at 17:04, "Keith Medcalf" <kmedc...@dessus.com> wrote:

>>> No, it is all about preparing, so there is no need to insert data.
>>> When we perform the query "delete from A where id=1;"  on the
>>> databases from the zip file, we get the following timings:
>>> 
>>> 500 tables - 10 msec in total
>>> 1000 tables - 25 msec in total
>>> 5000 tables - 298 msec in total
>>> 10000 tables - 985 msec in total
>>> 
>>> What we would indeed expect is to have neglectible timings. Perhaps
>>> our interpretation of neglectible differs? Could you please tell me
>>> what your timing is on the 10000 tables database?
>>> 
>>> We used the .timer ON command in the SQLite command shell utility as
>>> well as timing from our own application that has SQLite integrated.
> 
> The vdbe program is 20 times larger for 10000 tables versus 500 tables (400K 
> instructions for the later -vs- 20K for the former), and this appears to be 
> where the time is spent -- generating all the foreign key checking and 
> trigger code.  Perhaps the memory allocator has issues when building such a 
> huge vdbe set (I haven't looked at the code, but is it perchance doing a lot 
> of realloc's as more triggers are added?)

That is something we suspected too. We already made some tests where we timed 
the time needed for all memory allocations executed in the entire operation. In 
total for the 10000 tables test this was somewhere around 25 msec. Since this 
is just a little overhead and the instructions as you point out have a linear 
increasement this still does not explain the polynomial increasement in 
preperation time.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to