[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1296868 - /subversion/trunk/subversion/libsvn_fs_fs/rep-cache-db.sql

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Tue, 06 Mar 2012 17:35:42 +0000

Philip Martin <philip.martin_at_wandisco.com> writes:

> It may be TEXT but it is also PRIMARY KEY and according to the SQLite
> docs:
>
> http://sqlite.org/lang_createtable.html
>
> INTEGER PRIMARY KEY columns aside, both UNIQUE and PRIMARY KEY
> constraints are implemented by creating an index in the database (in
> the same way as a "CREATE UNIQUE INDEX" statement would). Such an
> index is used like any other index in the database to optimize
> queries. As a result, there often no advantage (but significant
> overhead) in creating an index on a set of columns that are already
> collectively subject to a UNIQUE or PRIMARY KEY constraint.

If I create a repository using 1.7 and look at the rep-cache.db I see:

$ sqlite3 rep-cache.db "select * from sqlite_master" | grep index
index|sqlite_autoindex_rep_cache_1|rep_cache|4|

An index has been created automatically and so adding another index can
only slow things down.

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com
Received on 2012-03-06 18:36:19 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.