Am 27.10.2017 um 21:59 schrieb David Raymond:
Also getting 31ms for both...
Thanks for testing that guys...

I was able to get similar timings (about 30msec), when the
(quite large) resultset-output was delegated into a file...

To avoid doing expensive File-IO in that test, I'd recommend
to run it again with the two small Files (SQL1.txt and
SQL2.txt), which I've now included in the ZipFile...
Here again the Link: http://vbRichClient.com/Downloads/NWind.zip

With these two Files, I get the following results (on a Win8.1 machine):

sqlite> .read SQL1.txt
Run Time: real 0.000 user 0.000000 sys 0.000000
Run Time: real 0.010 user 0.000000 sys 0.000000
Run Time: real 0.000 user 0.000000 sys 0.000000
sqlite>

sqlite> .read SQL2.txt
Run Time: real 0.000 user 0.000000 sys 0.000000
Run Time: real 0.006 user 0.000000 sys 0.000000
Run Time: real 0.000 user 0.000000 sys 0.000000
sqlite>

Note: SQL1-Text is copying into an InMemory-Temp-Table
from the Invoices-View - whilst SQL2 is doing the same
from "directly given SQL" (the same as used for the ViewDef).

The timings in both cases vary about +-1msec -
the values as posted represent the median-values.
Not really factor 2 (as encountered when copying into an
inmemory-resultsets of my wrapper-library) - but nearly so.

Though looking at the explain output it looks for the view/subroutine/subquery version it's spending like extra machine steps copying every result row from one set of registers to another.

Yep, that Extra-copying of the RowValues seems to be the culprit
(the Select has a decent Field-Count - and these efforts
seem to sum-up over the scanned Records then).

Olaf

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

Reply via email to