From: | James Cloos <cloos(at)jhcloos(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Josh Berkus <josh(at)agliodbs(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net> |
Subject: | Re: Testing 9.2 in ~production environment |
Date: | 2012-06-20 21:52:27 |
Message-ID: | m3y5nh8xcc.fsf@carbon.jhcloos.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)bar' AND ownerid=7;
to using:
WHERE lower(name) = lower('foo(at)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(at)jhcloos(dot)com> OpenPGP: 1024D/ED7DAEA6
From | Date | Subject | |
---|---|---|---|
Next Message | Kevin Grittner | 2012-06-20 22:11:44 | Re: Testing 9.2 in ~production environment |
Previous Message | Cédric Villemain | 2012-06-20 21:29:16 | Re: pg_prewarm |