From: | Gregory Maxwell <greg(at)z(dot)ml(dot)org> |
---|---|
To: | Taral <taral(at)cyberjunkie(dot)com> |
Cc: | pgsql-general(at)postgreSQL(dot)org |
Subject: | Re: [GENERAL] Generic search |
Date: | 1998-12-04 18:13:19 |
Message-ID: | Pine.LNX.3.96.981204131040.1764A-100000@z.ml.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Fri, 4 Dec 1998, Taral wrote:
> >hygea=> explain select * from comuni where nome = 'A%';
> >NOTICE: QUERY PLAN:
> >Index Scan using nome_comune_idx on comuni (cost=2.05 size=2 width=84)
> >^^^^^
>
> The question was about LIKE, not =. Because LIKE uses regexp-style matching and
> we have no substring index functionality, it cannot use the index. If you're
> always matching on the first character, you can do something like fulltextindex
> does and use triggers and a second (indexed) table to be able to match on the
> first character only.
Actually, on a beginging string only search you can do:
explain select * from td_prices where manu~'^IBM';
NOTICE: QUERY PLAN:
Index Scan on td_prices (cost=682.34 size=1 width=64)
Thats using a btree index. :)
You can't do a case insensitive search though.
From | Date | Subject | |
---|---|---|---|
Next Message | Jackson, DeJuan | 1998-12-04 18:22:58 | RE: [GENERAL] question 2 |
Previous Message | ZioBudda | 1998-12-04 18:06:12 | question 3 |