| От | Tom Lane |
|---|---|
| Тема | Re: Cursor fetch performance issue |
| Дата | |
| Msg-id | 7727.1327440497@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Cursor fetch performance issue (Tony Capobianco <tcapobianco@prospectiv.com>) |
| Список | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера