Обсуждение: regular expression and index on 7.2

Поиск
Список
Период
Сортировка

regular expression and index on 7.2

От
Holger Dörl
Дата:
Hi,

I tried the following on 7.1.3-38 and pgsl used the index:

EXPLAIN
mp3base=# explain
mp3base-# select * from mp3_
mp3base-# where name ~ '^cre';
NOTICE:  QUERY PLAN:

Index Scan using mp3_name on mp3_  (cost=0.00..8.14 rows=10 width=28)

On an other machine I've a psql 7.2-1 and I got this result:

mp3base=# explain
mp3base-# select * from mp3_
mp3base-# where name ~ '^cre';
NOTICE:  QUERY PLAN:
Seq Scan on mp3_  (cost=0.00..2150.93 rows=363 width=794)
On both machines is this index:
CREATE INDEX "mp3_name" ON mp3_(name);

Do you have any idea why it dosn't work with 7.2 ????
And what can I do to use the index ????
(7.2 runs on a mandrake and 7.1.3 on suseboth databases are created as: createdb -E LATIN1 mp3base

Thx Holger

______________________________________________________________________________
Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr!
Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=7



Re: regular expression and index on 7.2

От
Tom Lane
Дата:
Holger Dörl <holger.doerl@web.de> writes:
> Do you have any idea why it dosn't work with 7.2 ????

Perhaps you initdb'd 7.2 in a non-C locale?  (contrib/pg_controldata
is the way to check if you're not sure.)

> And what can I do to use the index ????

re-initdb is the only way to change the database locale if it's
wrong :-(
        regards, tom lane