Re: Problem: query becomes slow when calling a fast user defined function.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Problem: query becomes slow when calling a fast user defined function.
Дата
Msg-id 9625.1149561782@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Problem: query becomes slow when calling a fast user defined function.  (Dan Libby <dan@libby.com>)
Список pgsql-performance
Dan Libby <dan@libby.com> writes:
> Or failing that, I'd at least like to understand why the planner
> is deciding not to use the category_lang index when the result
> set is coming from a function instead of a "regular" table.

The planner defaults to assuming that set-returning functions return
1000 rows (as you can see in the EXPLAIN output).  A plan that would
win for a single returned row would lose badly at 1000 rows ...
and vice versa.  See the archives for various debates about how to
get a better estimate; it's not an easy problem.

            regards, tom lane

В списке pgsql-performance по дате отправления:

Предыдущее
От: Dan Libby
Дата:
Сообщение: Problem: query becomes slow when calling a fast user defined function.
Следующее
От: "Andrus"
Дата:
Сообщение: Re: How to force Postgres to use index on ILIKE