Re: [sqlite] using index when using concatination

2011-07-10 Thread Igor Tandetnik
Black, Michael (IS) wrote: > 3.7.4 doesn't indicate it will use an index in either case with like...but > glob seems to call the index...why does glob use the > index but like does not? LIKE is case-insensitive by default, while GLOB is case-sensitive. Thus, LIKE works

Re: [sqlite] using index when using concatination

2011-07-10 Thread Black, Michael (IS)
qlite.org] on behalf of Black, Michael (IS) [michael.bla...@ngc.com] Sent: Sunday, July 10, 2011 12:03 PM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] using index when using concatination 3.7.4 doesn't indicate it will use an index in either case with like...but glob seems to call

Re: [sqlite] using index when using concatination

2011-07-10 Thread Black, Michael (IS)
AM To: sqlite-users@sqlite.org Subject: EXT :Re: [sqlite] using index when using concatination Baruch Burstein <bmburst...@gmail.com> wrote: > I am using the following SQL statement for SQLite: > >select * from words where "word" like ? || '%' || ? ; > &g

Re: [sqlite] using index when using concatination

2011-07-10 Thread Igor Tandetnik
Baruch Burstein wrote: > I am using the following SQL statement for SQLite: > >select * from words where "word" like ? || '%' || ? ; > > In order to bind parameters to the first and last letters. I have tested > this both with and without an index on the column `word`,

Re: [sqlite] using index when using concatination

2011-07-10 Thread Igor Tandetnik
Igor Tandetnik wrote: > Black, Michael (IS) wrote: >> Any particular reason you can't build your own string and just pass one >> parameter? >> >> select * from words where "word" like ?; > > That won't help - SQLite still can't use the index. I

Re: [sqlite] using index when using concatination

2011-07-10 Thread Igor Tandetnik
Black, Michael (IS) wrote: > Any particular reason you can't build your own string and just pass one > parameter? > > select * from words where "word" like ?; That won't help - SQLite still can't use the index. > And any reason why you don't create a 2nd field holds

Re: [sqlite] using index when using concatination

2011-07-10 Thread Black, Michael (IS)
_ From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Baruch Burstein [bmburst...@gmail.com] Sent: Sunday, July 10, 2011 7:27 AM To: sqlite-users@sqlite.org Subject: EXT :[sqlite] using index when using concatination I am using the following SQL statement

[sqlite] using index when using concatination

2011-07-10 Thread Baruch Burstein
I am using the following SQL statement for SQLite: select * from words where "word" like ? || '%' || ? ; In order to bind parameters to the first and last letters. I have tested this both with and without an index on the column `word`, and the results are the same. However, when running the