[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pgsql-performance
Subject:    Re: Order of execution
From:       Jean-Christophe Boggio <postgresql () thefreecat ! org>
Date:       2021-04-27 19:49:59
Message-ID: 83950412-6367-5bb8-aeb1-a07603acd649 () thefreecat ! org
[Download RAW message or body]

Hello,

Le 27/04/2021 à 20:52, luis.roberto@siscobra.com.br a écrit  :
> My question is: is it possible to optimize function order execution?

I guess you could change the cost of one of the functions.


I personally rewrite my queries but I don't know if it's good practice:

WITH pre AS (
   SELECT client_id
   FROM clients
   WHERE some_other_func(client_id)
)
SELECT *
FROM clients
JOIN pre USING(client_id)
WHERE some_func(client_id)

Best regards,

JC


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic