Re: LIKE not using indexes (due to locale issue?)

Поиск
Список
Период
Сортировка
От Ow Mun Heng
Тема Re: LIKE not using indexes (due to locale issue?)
Дата
Msg-id 1214374527.9173.3.camel@neuromancer.home.net
обсуждение исходный текст
Ответ на Re: LIKE not using indexes (due to locale issue?)  (Klint Gore <kgore4@une.edu.au>)
Ответы Re: LIKE not using indexes (due to locale issue?)  (Klint Gore <kgore4@une.edu.au>)
Список pgsql-general
On Wed, 2008-06-25 at 14:58 +1000, Klint Gore wrote:
> Ow Mun Heng wrote:
> > explain select * from d_trr where revision like '^B2.%.SX'
> > --where ast_revision  = 'B2.M.SX'
> >
> > Seq Scan on d_trr  (cost=0.00..2268460.98 rows=1 width=16)
> >   Filter: ((revision)::text ~~ '^B2.%.SX'::text)
> >
> > show lc_collate;
> > en_US.UTF-8
> >
> > Is it that this is handled by tsearch2? Or I need to do the locale to
> > "C" for this to function?
> >
> See http://www.postgresql.org/docs/8.3/interactive/indexes-opclass.html.
> It tells you how to create an index that like might use in non-C locales.

Just more information. This columns is created with the varchar type.

original index is created using

CREATE INDEX idx_d_ast
  ON xmms.d_trh
  USING btree
  (revision varchar_pattern_ops);


CREATE INDEX idx_d_ast2
  ON xmms.d_trh
  USING btree
  (revision);

after creating it, seems like it is still doing the seq_scan.
So what gives? Can I get more clues here?





В списке pgsql-general по дате отправления:

Предыдущее
От: Clemens Schwaighofer
Дата:
Сообщение: Re: Probably been asked a hundred times before.
Следующее
От: "Asko Oja"
Дата:
Сообщение: Re: replication