Re: Order of execution - Mailing list pgsql-performance

From Jean-Christophe Boggio
Subject Re: Order of execution
Date
Msg-id 83950412-6367-5bb8-aeb1-a07603acd649@thefreecat.org
Whole thread Raw
In response to Order of execution  (luis.roberto@siscobra.com.br)
List pgsql-performance
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



pgsql-performance by date:

Previous
From: luis.roberto@siscobra.com.br
Date:
Subject: Order of execution
Next
From: aditya desai
Date:
Subject: Error while calling proc with table type from Application