[[[ * subversion/libsvn_fs_fs/revprops-db.sql (i_revision): Drop this index as redundant and overhead-inducing, since the UNIQUE directive already creates (another) index.
Found by: philip ]]] [[[ Index: subversion/libsvn_fs_fs/revprops-db.sql =================================================================== --- subversion/libsvn_fs_fs/revprops-db.sql (revision 1124675) +++ subversion/libsvn_fs_fs/revprops-db.sql (working copy) @@ -28,8 +28,14 @@ create table revprop (revision integer UNIQUE not null, properties BLOB not null); -create index i_revision on revprop (revision); +/* Unreleased 1.7-dev libraries also contained an index: + CREATE INDEX i_revision ON revprop (revision); + This was removed since the UNIQUE statement already constructs + its own index. + */ + + pragma user_version = 1; ]]] I'm also attaching the results of 'sqlite3 EXPLAIN INSERT' on revprops.db, with the index as created by default and then without the index.
/* INDEX i_revision in place */ sqlite> EXPLAIN INSERT INTO revprop VALUES (2, '( ) '); |Trace|0|0|0||00| |Goto|0|27|0||00| |OpenWrite|0|3|0|2|00| |OpenWrite|1|5|0|keyinfo(1,BINARY)|00| |OpenWrite|2|4|0|keyinfo(1,BINARY)|00| |NewRowid|0|4|0||00| |Integer|2|5|0||00| |String8|0|6|0|( ) |00| |HaltIfNull|19|2|5|revprop.revision may not be NULL|00| |HaltIfNull|19|2|6|revprop.properties may not be NULL|00| |SCopy|5|7|0||00| |SCopy|4|8|0||00| |MakeRecord|7|2|1|db|00| |SCopy|5|7|0||00| |SCopy|4|8|0||00| |MakeRecord|7|2|2|db|00| |SCopy|4|9|0||00| |IsUnique|2|19|9|7|00| |Halt|19|2|0|column revision is not unique|00| |IdxInsert|2|2|0||10| |IdxInsert|1|1|0||10| |MakeRecord|5|2|9|db|00| |Insert|0|9|4|revprop|1b| |Close|0|0|0||00| |Close|1|0|0||00| |Close|2|0|0||00| |Halt|0|0|0||00| |Transaction|0|1|0||00| |VerifyCookie|0|2|0||00| |TableLock|0|3|1|revprop|00| |Goto|0|2|0||00|
sqlite> DROP INDEX i_revision; sqlite> EXPLAIN INSERT INTO revprop VALUES (2, '( ) '); |Trace|0|0|0||00| |Goto|0|21|0||00| |OpenWrite|0|3|0|2|00| |OpenWrite|1|4|0|keyinfo(1,BINARY)|00| |NewRowid|0|3|0||00| |Integer|2|4|0||00| |String8|0|5|0|( ) |00| |HaltIfNull|19|2|4|revprop.revision may not be NULL|00| |HaltIfNull|19|2|5|revprop.properties may not be NULL|00| |SCopy|4|6|0||00| |SCopy|3|7|0||00| |MakeRecord|6|2|1|db|00| |SCopy|3|8|0||00| |IsUnique|1|15|8|6|00| |Halt|19|2|0|column revision is not unique|00| |IdxInsert|1|1|0||10| |MakeRecord|4|2|8|db|00| |Insert|0|8|3|revprop|1b| |Close|0|0|0||00| |Close|1|0|0||00| |Halt|0|0|0||00| |Transaction|0|1|0||00| |VerifyCookie|0|3|0||00| |TableLock|0|3|1|revprop|00| |Goto|0|2|0||00|