On Thu, Jun 21, 2012 at 08:30:31AM -0400, Richard Hipp scratched on the wall:
> On Thu, Jun 21, 2012 at 1:47 AM, nn6eumtr wrote:
>
> >
> > If I have a table:
> >
> > create table tmp (
> > x integer,
> > y integer
> > )
> >
> > And a an index with compound key:
> >
> > create unique index idx o
nn6eumtr wrote:
> And I did a query:
>
> select * from tmp where x = 9
>
> Would sqlite know how to use the index to find records where x = 9? Or
> would it opt for a scan instead?
Why not ask SQLite itself? In sqlite3 console, or your favorite SQLite
management tool, run this query:
EXPLAIN
.@sqlite.org] on
behalf of Richard Hipp [d...@sqlite.org]
Sent: Thursday, June 21, 2012 7:30 AM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] sqlite compound keys
On Thu, Jun 21, 2012 at 1:47 AM, nn6eumtr wrote:
>
> If I have a table:
>
> create table tmp (
&g
On Thu, Jun 21, 2012 at 1:47 AM, nn6eumtr wrote:
>
> If I have a table:
>
> create table tmp (
> x integer,
> y integer
> )
>
> And a an index with compound key:
>
> create unique index idx on tmp (x, y);
>
> And I did a query:
>
> select * from tmp where x = 9
>
> Would sqlite know how to use
If I have a table:
create table tmp (
x integer,
y integer
)
And a an index with compound key:
create unique index idx on tmp (x, y);
And I did a query:
select * from tmp where x = 9
Would sqlite know how to use the index to find records where x = 9? Or
would it opt for a scan instead?
5 matches
Mail list logo