Thanks for addressing this, Richard. Preset the legacy_file_format pragma to the value of the primary database so that a VACUUM will not unknowingly alter the setting. Ticket #2804.
http://www.sqlite.org/cvstrac/chngview?cn=4574 Could you please update the PRAGMA documentation to reflect the new preset behavior of "PRAGMA legacy_file_format;"? --- Joe Wilson <[EMAIL PROTECTED]> wrote: > When I compare the database bytes before and after the 2nd > process VACUUM these bytes differ: > > zero-based value value > byte offset before after my guess of what it is > 2nd VAC 2nd VAC > ----------- ------- ------- ---------------------- > 27 2 5 File change counter? > 43 2 5 Schema cookie? > 47 4 1 meta[1], file format? > > Doesn't byte offset 47 correspond to meta[1], the file format > of the schema layer? > > --- Joe Wilson <[EMAIL PROTECTED]> wrote: > > Regarding http://www.sqlite.org/cvstrac/tktview?tn=2804 ... > > > > I'm confused by the explanation. > > Ignoring the PRAGMA for the moment, I was surprised that DESC > > indexes were not available after a reconnect and VACUUM, as shown > > in the example: > > > > $ rm -f foo.db > > $ ./sqlite3-3.5.3.bin foo.db > > SQLite version 3.5.3 > > Enter ".help" for instructions > > sqlite> PRAGMA legacy_file_format=OFF; > > sqlite> CREATE TABLE abc(a,b,c); > > sqlite> CREATE INDEX abc_i on abc(b desc, c asc, a desc); > > sqlite> explain query plan select * from abc order by b desc, c asc, a desc; > > 0|0|TABLE abc WITH INDEX abc_i ORDER BY > > sqlite> vacuum; > > sqlite> explain query plan select * from abc order by b desc, c asc, a desc; > > 0|0|TABLE abc WITH INDEX abc_i ORDER BY > > sqlite> .q > > > > $ ./sqlite3-3.5.3.bin foo.db > > SQLite version 3.5.3 > > Enter ".help" for instructions > > sqlite> explain query plan select * from abc order by b desc, c asc, a desc; > > 0|0|TABLE abc WITH INDEX abc_i ORDER BY > > sqlite> vacuum; > > sqlite> explain query plan select * from abc order by b desc, c asc, a desc; > > 0|0|TABLE abc > > > > Notice that the DESC index is no longer available after the second > > process' VACUUM was run. > > > > If this isn't the file format being changed, then why isn't the DESC > > index being used? > > > > Is this by design? ____________________________________________________________________________________ Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------