Re: [sqlite] How to improve performance for some query statements

2009-03-03 Thread Peng Huang
On Wed, Mar 4, 2009 at 12:24 PM, John Machin wrote: > On 4/03/2009 2:48 PM, Peng Huang wrote: > > On Wed, Mar 4, 2009 at 11:40 AM, John Machin > wrote: > > > >> On 4/03/2009 2:12 PM, Peng Huang wrote: > >>> Hi Igor Tandetnik, > >>> > >>> Thanks for your quick reply. > >>> > >>> Your solution wor

Re: [sqlite] How to improve performance for some query statements

2009-03-03 Thread John Machin
On 4/03/2009 2:48 PM, Peng Huang wrote: > On Wed, Mar 4, 2009 at 11:40 AM, John Machin wrote: > >> On 4/03/2009 2:12 PM, Peng Huang wrote: >>> Hi Igor Tandetnik, >>> >>> Thanks for your quick reply. >>> >>> Your solution works. But in some cases, each y%d may has two or three >>> choices. So the

Re: [sqlite] How to improve performance for some query statements

2009-03-03 Thread Peng Huang
On Wed, Mar 4, 2009 at 11:40 AM, John Machin wrote: > On 4/03/2009 2:12 PM, Peng Huang wrote: > > Hi Igor Tandetnik, > > > > Thanks for your quick reply. > > > > Your solution works. But in some cases, each y%d may has two or three > > choices. So the SQL will become very complex, we need ( 2 * 2

Re: [sqlite] How to improve performance for some query statements

2009-03-03 Thread John Machin
On 4/03/2009 2:12 PM, Peng Huang wrote: > Hi Igor Tandetnik, > > Thanks for your quick reply. > > Your solution works. But in some cases, each y%d may has two or three > choices. So the SQL will become very complex, we need ( 2 * 2 * 2 * 2) sub > where statements. Does SQLite have some build-in f

Re: [sqlite] How to improve performance for some query statements

2009-03-03 Thread Peng Huang
Hi Igor Tandetnik, Thanks for your quick reply. Your solution works. But in some cases, each y%d may has two or three choices. So the SQL will become very complex, we need ( 2 * 2 * 2 * 2) sub where statements. Does SQLite have some build-in features to optimize those kinds of SQL statements? Or

Re: [sqlite] How to improve performance for some query statements

2009-03-03 Thread Igor Tandetnik
"Peng Huang" wrote in message news:fb7465350903031832w20777903kc5bb1f641f455...@mail.gmail.com > But we need add some new requirements. We need query phrases by > length of phrases (ylen) and pronounce of each characters in phrase, > but the pronounce of one or two characters may be two different

[sqlite] How to improve performance for some query statements

2009-03-03 Thread Peng Huang
Hi SQLite hackers, I am using sqlite in a Chinese input method. The db schema is below, and the table contains about 100 records. CREATE TABLE py_phrase ( ylen INTEGER, /* length of phrase. How many characters in phrase */ y0 INTEGER, y1 INTEGER, y2 INTEGER, y3 INTEGER, /* pronounce o