NEAT! yeah i'll definitely have to recompile and check that out - the nLt column sounds interesting!? [1]
But I'm not sure what the end game would be - any sample of ANALYZE results wouldn't generalize to any other containers of a similar size - so I'd be looking at always running with a sqlite3 compiled with that option and then running ANALYZE when a database seems large enough that it might benefit? I'm sorta curious if the ANALYZE on these large tables will be faster than the actual query and/or if running the query with the analyze results populated is expected to make the query execute faster!? Maybe I'll have more questions after I test it out. Thanks! 1. https://www.sqlite.org/fileformat2.html#section_2_6_6 On Fri, May 27, 2016 at 1:23 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 27 May 2016, at 9:02pm, Clay Gerrard <clay.gerr...@gmail.com> wrote: > > > Is there a more obvious way to find this "middle" of a large ordered > query > > in an indexed table? Just estimating between the min and max doesn't > > always seem to represent a good split since the distribution of prefixes > is > > not always uniform? > > Yeah. SQLite is designed to protect you from having to know how a > balanced tree works. Also, the "count(*)" operation is not as cheap in > SQLite as you might expect it to be, because the number of rows in a table > isn't stored anywhere. > > Have you looked at the tables generated by ANALYZE ? You may have to > compile your own version of SQLite (check with > > PRAGMA compile_options > > ) so that you have a version with "SQLITE_ENABLE_STAT4" enabled. See the > documentation in sections 2.6.5 and 2.6.6 to see if you think either will > help. > > Simon. > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users