Re: Important speed difference between a query and a
В списке pgsql-performance по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Important speed difference between a query and a |
| Дата | |
| Msg-id | 14131.1051199816@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Important speed difference between a query and a (Frederic Jolliton <fred-pg@jolliton.com>) |
| Ответы |
Re: Important speed difference between a query and a
|
| Список | pgsql-performance |
Frederic Jolliton <fred-pg@jolliton.com> writes:
>> To "emulate" a parametred view, I created a function as follow:
>>
>> CREATE FUNCTION get_info (integer) RETURNS SETOF type_get_info
>> AS '...' <- here the query show below, where 'LIMIT $1' is used instead of 'LIMIT 10'
>> LANGUAGE sql;
> So, the query in the function is not using index but the exact same
> query alone does !
But it's not the same query, is it? With "LIMIT $1" the planner can't
know what the limit value is exactly, so it has to generate a plan that
won't be too unreasonable for either a small or a large limit.
regards, tom lane
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера