Hi,

I'm finding that if I compile with either SQLITE_ENABLE_STAT3 or
SQLITE_ENABLE_STAT4, repeatedly executing a prepared SELECT statement is
substantially slower.

I have a silly benchmark app that populates a database with test data,
creates some pertinent indexes, runs ANALYZE, then executes a particular
SELECT statement against the database several thousand times. Executing all
these SELECTs normally takes a few seconds, but it's 10x slower when SQLite
is compiled with SQLITE_ENABLE_STAT4.

Curious, I ran my test app under Visual Studio's profiler, and saw that a
substantial amount of time is spent in calls to sqlite3Reprepare(). Reading
the docs at http://www.sqlite.org/c3ref/prepare.html, I assume SQLlite is
recompiling the statement because it thinks it can find a better query plan
based on the parameters I'm binding to it. Unfortunately, the time needed
for this recompilation is dramatically outweighing any potential savings
that a better query plan could offer!

Has anyone else had a similarly negative experience with
SQLITE_ENABLE_STAT3/4?

Cheers,
Nick
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to