--- "Maxim V. Shiyanovsky" <[EMAIL PROTECTED]> wrote:
> Suppose I have simple table:
>
> CREATE TABLE [profile_data] (
> [profile_id] INTEGER,
> [version] INTEGER);
>
> CREATE INDEX [by_id] ON [profile_data] ([id]);
>
> Why
>
> sqlite> explain query plan
>...> select distinct(profile_i
In the call to create index, it looks like you're creating a duplicate
index on [id], which I believe references the default btree id (also
called rowid.) If you change that line to:
CREATE INDEX [by_id] ON [profile_data] ([profile_id]);
your index should be used (though whether indexes get use
Suppose I have simple table:
CREATE TABLE [profile_data] (
[profile_id] INTEGER,
[version] INTEGER);
CREATE INDEX [by_id] ON [profile_data] ([id]);
Why
sqlite> explain query plan
...> select distinct(profile_id) from profile_data;
0|0|TABLE profile_data
Does not use index?
3 matches
Mail list logo