From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Tony Capobianco <tcapobianco(at)prospectiv(dot)com> |
Cc: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org |
Subject: | Re: Cursor fetch performance issue |
Date: | 2012-01-24 21:28:17 |
Message-ID: | 7727.1327440497@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
Tony Capobianco <tcapobianco(at)prospectiv(dot)com> writes:
> Running just the sql of the function returns only 10 rows:
> pg=# SELECT m.memberid, m.websiteid, m.emailaddress,
> pg-# m.firstname, m.lastname, m.regcomplete, m.emailok
> pg-# FROM members m
> pg-# WHERE m.emailaddress LIKE 'test(dot)email(at)hotmail(dot)com'
> pg-# AND m.changedate_id < 5868 ORDER BY m.emailaddress, m.websiteid;
Based on that, I'd bet your problem is that the function is executing
WHERE m.emailaddress LIKE $1
(for some spelling of $1) and you are therefore not getting the benefit
of the index optimizations that can happen when LIKE's pattern is
constant. Do you actually need LIKE rather than just "=" here?
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tony Capobianco | 2012-01-24 21:34:06 | Re: Cursor fetch performance issue |
Previous Message | Pavel Stehule | 2012-01-24 21:17:11 | Re: Cursor fetch performance issue |