Am 21.02.2008 um 10:30 schrieb Neville Franks:

> I have created a table with a column: tag text primary key
>
> When I do:
> sqlite> .indices tags
> sqlite_autoindex_tags_1
>
> I only see the one index which I assume is for the ROWID clm.

No, this is the index for your 'tag' column as can be seen by

sqlite> EXPLAIN QUERY PLAN SELECT * FROM tags WHERE tag='foo';
0|0|TABLE tags WITH INDEX sqlite_autoindex_tags_1

(see also <http://sqlite.org/lang_createtable.html>, especially the  
section "Specifying a PRIMARY KEY..." for more details)


> I have
> inserted a row into the table, in case that is relevant.
>
> My understanding is that a primary key column will have an index. So
> my question is where is the index for the 'tag' column?
>
> This is the complete CREATE TABLE SQL.
>
> CREATE TABLE tags
> (
>    tag text primary key,
>    description text,
>    date_created text DEFAULT CURRENT_TIMESTAMP,
>    style text
> )

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to