On 29 Aug 2019, at 3:09pm, dirdi <sql...@dirdi.name> wrote:

> Does one have an explanation for this behavior?

> Is it expected that the REINDEX command produces other results than 
> "manually" recreation of an index?
> If yes, under which circumstances does this happen?
> And is there some way to measure the "quality" of an index / if it has been 
> scattered?

Just in case, please run an integrity-check on the database as it is before you 
delete/rebuild the index.

What you're seeing seems weird to me.  One thing that comes to mind is that 
deleting and recreating an index might put all the pages of the new index at 
the end of the database file, whereas the REINDEX command might reuse the pages 
which the index is currently using.  But I don't know whether this is how 
SQLite really works.

You might be able to learn more about the various versions of that index using 
this:

<https://sqlite.org/sqlanalyze.html>

It may show that the various versions of idx1 you see/create take different 
numbers of pages, or have different depths.  However, I agree with you that the 
amount of time disparity is unexpected.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to