Re: Testing 9.2 in ~production environment

Поиск
Список
Период
Сортировка
От James Cloos
Тема Re: Testing 9.2 in ~production environment
Дата
Msg-id m3y5nh8xcc.fsf@carbon.jhcloos.org
обсуждение исходный текст
Ответ на Re: Testing 9.2 in ~production environment  (James Cloos <cloos@jhcloos.com>)
Ответы Re: Testing 9.2 in ~production environment  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers
As a followup, I find that I can avoid the seq scan by adding an index
to that table as:
  create index mb_name_own_idx on mb ( lower(name), ownerid );

and changing the query from using the idiom:
 WHERE name ILIKE 'foo@bar' AND ownerid=7;

to using:
 WHERE lower(name) = lower('foo@bar') AND ownerid=7;

which saves 20+ ms on each of the 30+ k such selects in a full run.

I haven't tested how fast it would be with that change and a utf8 ctype.

Because of how the middleware achives its portability between pg, my et al,
changing it to use lower and = will require significant surgery.

Is there any way to specify the index such that the ILIKE query will use
said index?

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6


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

Предыдущее
От: Cédric Villemain
Дата:
Сообщение: Re: pg_prewarm
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Testing 9.2 in ~production environment