Order of execution

Поиск
Список
Период
Сортировка
От luis.roberto@siscobra.com.br
Тема Order of execution
Дата
Msg-id 1849398212.2153796.1619549557535.JavaMail.zimbra@siscobra.com.br
обсуждение исходный текст
Ответы Re: Order of execution
Список pgsql-performance
Hi!

My question is: is it possible to optimize function order execution?

Here's explanation:

I have a bunch of queries that have volatile quals, some more than one. For example:

SELECT *
  FROM clients
 WHERE some_func(client_id)
   AND some_other_func(client_id) 

Now, I know that having volatile function quals is not a good practice, but alas, it is what it is.

In this contrived example, some_func filters about 50% of clients, whereas some_other_func around 5%.

If PostgreSQL would execute them "serially", some_other_func would only run for 50% of the clients, cutting execution
time.What I've seen is that volatile functions execute always.
 

Is the reason this happen because the function can modify the result from the outer query?

Luis R. Weck 



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

Предыдущее
От: Marc Millas
Дата:
Сообщение: Re: Does btrfs on Linux have a negative performance impact for PostgreSQL 13?
Следующее
От: Jean-Christophe Boggio
Дата:
Сообщение: Re: Order of execution