2 Comments
User's avatar
Pgm's avatar

Hi, what I don't get is why postgres insists on using a parameter outside of the query: plan_cache_mode. It would be much more user friendly if we could use a word inside the query like 'select with-custom-plan * from'. Postgres already has such features, e.g. the 'materialized' keyword. I am no advocate for oracle style hints, but either postgres finds a way to solve the problem without outside parameters or there should be syntax to put inside the query to solve it manually.

Expand full comment
Andrei Lepikhov's avatar

I think you may find some reasons in the following discussions:

https://www.postgresql.org/message-id/flat/4E9AFBF9.80708%40wulczer.org

https://www.postgresql.org/message-id/3e36717b-689b-473c-a40f-bb35dd56ea5b%40www.fastmail.com?utm_source=chatgpt.com

In short, there are some issues immediately raise that may cause code complexity and additional overhead.

Expand full comment