How can I optimize a research on text field? - Mailing list pgsql-sql

From Jerome Knobl
Subject How can I optimize a research on text field?
Date
Msg-id 3639DD8F.2CB99B94@mandanet.ch
Whole thread Raw
Responses Re: [SQL] How can I optimize a research on text field?
List pgsql-sql
Hello,

What index method can I use for a text field to have a better
optimisation.

I tried btree and hash method, but when I make a clause like : where nom
like '%PICASSO%'; the request don't use any index!?!

example:
mayer98=> explain select count(*) from artistes, oeuvres where
artistes.ref=oeuvres.refartiste and nom like '%PICASSO%';
NOTICE:  QUERY PLAN:

Aggregate  (cost=4894.04 size=0 width=0)
  ->  Nested Loop  (cost=4894.04 size=874 width=8)
        ->  Seq Scan on artistes  (cost=4837.37 size=1 width=4)
        ->  Index Scan on oeuvres  (cost=56.67 size=685510 width=4)

EXPLAIN

Jérôme Knöbl



pgsql-sql by date:

Previous
From: Petter Reinholdtsen
Date:
Subject: Access rights to sequence.nextval?
Next
From: Mike Meyer
Date:
Subject: Re: [SQL] How can I optimize a research on text field?