On 2018/07/27 1:59 PM, Dominique Devienne wrote:

Sigh. We already have 4 different check pragmas (cell-size, fk, integrity,
quick).
One more for views seems perfectly in line with those. Did anyone raise the
same
old light-code-bloat argument for those too, in the past? I for one cringe
every time
I read it nowadays. In any case, it's always entirely at the discretion of
DRH, and
although he of course considers the communities views (pun intended) I'm
sure,
at the end of the day he's the sole decider.

Yeah, I meant Richard (or one of the  devs at least) - apologies, I assumed that was obvious.



One caution, some views that have ordered sub-selects linked to very
large tables (or other stuff I don't know about) might take a long time
to even simply prepare - so perhaps not a good idea to automatically add
this after every script.

Really? I've never heard that preparing a statement depended on how large
tables accessed are.
Doesn't prepare only ever cares about data dictionaries (i.e. DDL stuff)
and not actual rows (DML stuff)?

Preparing is not only running the SQL parser and generating the VDBE
program for that statement?
If what you wrote was true, wouldn't that imply the result of prepare could
be different depending if the
prepare happens with a empty or "full" table? Or I completely misunderstood
your "large table" comment?

It's not the size of a direct table that matters, it's only when part of a sub-query that needs to be evaluated. At least, that's how I have it - I could be wrong.

I'm hoping someone who understands the internal mechanism more fully can provide a clear example. It might also be that it is simply required before the first step() and not during the prepare per sé. Last discussion on this was many moons and many versions of sqlite ago, too long for me to trust my memory.

So before propagating any misinformation, I'll appeal to the devs (or anyone who knows for sure), and ask: Is there ever a reason the "sqlite3_prepare()" and its ilk can take longer than a few milliseconds?  If so, how?


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

Reply via email to