Re: Cursor fetch performance issue - Mailing list pgsql-performance

From Tom Lane
Subject Re: Cursor fetch performance issue
Date
Msg-id 7727.1327440497@sss.pgh.pa.us
Whole thread Raw
In response to Re: Cursor fetch performance issue  (Tony Capobianco <tcapobianco@prospectiv.com>)
List pgsql-performance
Tony Capobianco <tcapobianco@prospectiv.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.email@hotmail.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

pgsql-performance by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Cursor fetch performance issue
Next
From: Tony Capobianco
Date:
Subject: Re: Cursor fetch performance issue