Re: [sqlite] sqlite compound keys

2012-06-21 Thread Jay A. Kreibich
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: > > > >

Re: [sqlite] sqlite compound keys

2012-06-21 Thread Igor Tandetnik
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

Re: [sqlite] sqlite compound keys

2012-06-21 Thread Black, Michael (IS)
.@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 <nn6eu...@gmail.com> wrote: > > If I have a table: &g

Re: [sqlite] sqlite compound keys

2012-06-21 Thread Richard Hipp
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] sqlite compound keys

2012-06-21 Thread nn6eumtr
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