Re: [PERFORM] How to force Postgres to use index on ILIKE

2006-06-06 Thread Tom Lane
"Andrus" <[EMAIL PROTECTED]> writes: >> 1) why are you using CHAR and not VARCHAR or TEXT? CHAR will give you >> problems using an index, period. > 1. I haven't seen any example where VARCHAR is better that CHAR for indexing The advice you were given is good, even if the explanation is bad. CHA

Re: [PERFORM] How to force Postgres to use index on ILIKE

2006-06-06 Thread Andrus
>> SELECT toode, nimetus >> FROM toode >> WHERE toode ILIKE 'x10%' ESCAPE '!' >> ORDER BY UPPER(toode ),nimetus LIMIT 100 >> >> runs 1 minute in first time for small table size. >> >> Toode field type is CHAR(20) > > 1) why are you using CHAR and not VARCHAR or TEXT? CHAR will give you

Re: [PERFORM] How to force Postgres to use index on ILIKE

2006-06-05 Thread Josh Berkus
Andrus, > SELECT toode, nimetus > FROM toode > WHERE toode ILIKE 'x10%' ESCAPE '!' > ORDER BY UPPER(toode ),nimetus LIMIT 100 > > runs 1 minute in first time for small table size. > > Toode field type is CHAR(20) 1) why are you using CHAR and not VARCHAR or TEXT? CHAR will give you

[PERFORM] How to force Postgres to use index on ILIKE

2006-06-05 Thread Andrus
I have UTF-8 Postgres 8.1 database on W2K3 Query SELECT toode, nimetus FROM toode WHERE toode ILIKE 'x10%' ESCAPE '!' ORDER BY UPPER(toode ),nimetus LIMIT 100 runs 1 minute in first time for small table size. Toode field type is CHAR(20) How to create index on toode field so that qu