Re: Implement hook for self-join simplification - Mailing list pgsql-hackers

From Andrey Lepikhov
Subject Re: Implement hook for self-join simplification
Date
Msg-id 18423a86-f51e-0115-8c0f-fcee7704b135@postgrespro.ru
Whole thread Raw
In response to Re: Implement hook for self-join simplification  (Leif Harald Karlsen <leifhka@ifi.uio.no>)
List pgsql-hackers
On 24/6/2022 23:43, Leif Harald Karlsen wrote:
> Thank you for the quick answer, and for the pointer to the patch! This 
> looks like just the thing I need! 
> On a more general note: What would, in general, be the best way to 
> implement such optimizations? Is there a good way to do this as an 
> extension, or is a patch the preferred way?
According to my experience, it depends on your needings.
For example, self-join-removal feature, or my current project - 
flattening of nested subqueries - is much more optimal to implement as a 
patch, because you can do it so early as possible and can generalize 
parts of the core code and thus, reduce size of your code a lot.
But if you want to use your code with many PG versions, even already 
working in production or you make just a research, without immediate 
practical result - your choice is an extension.

-- 
regards,
Andrey Lepikhov
Postgres Professional



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Core dump in range_table_mutator()
Next
From: Fabien COELHO
Date:
Subject: Re: Future Postgres 15 and Clang 15