Boosting cost estimates for some built-in functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Boosting cost estimates for some built-in functions
Дата
Msg-id 8971.1255891843@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Boosting cost estimates for some built-in functions  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
We recently saw a complaint about psql \d commands being quite slow
with many tables, which turned out to be because the planner was
putting a table_has_privilege() call where it would get executed a
lot, before other cheaper tests on pg_class.  This is not the
planner's fault --- it has no information that would suggest that
table_has_privilege() is any more expensive than any other built-in
function.

In another case I was looking at just now, it seems that to_tsquery()
and to_tsvector() are noticeably slower than most other built-in
functions, which is not surprising given the amount of mechanism that
gets invoked inside them.  It would be useful to tell the planner
about that to discourage it from picking seqscan plans that involve
repeated execution of these functions.

I'd like to suggest boosting the built-in cost estimates for the
xxx_has_privilege functions to perhaps 10.  to_tsquery and to_tsvector
maybe should be boosted even higher, but I don't have a good specific
number in mind.

Thoughts?
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Controlling changes in plpgsql variable resolution
Следующее
От: Robert Haas
Дата:
Сообщение: Re: LATERAL