Equivalence Rules
Equivalence Rules
Hi My question is: Does PostgreSQL implements equivalence rules(from those are listed in email's attachment)? Which function or which part of source code(in PostgreSQL ) implements the equivalence rules? I think, this should be implemented in query optimization part of PostgreSQL, but which rule and where, I don't know? I want to use that(function or part of source code), to produce the equivalence Relational Algebras (based on equivalence rules in attachment) for a given SQL query(Relational Algebra). Thanks
Re: Equivalence Rules
От:
Antonin Houska <antonin.houska@gmail.com>
Дата:
There are 2 kinds of rules in this document: for joins and for set operations. As for joins, I think they are all about *inner* joins. Postgres (IMO) "implements" them by not doing anything special if query only contains inner joins. On the other hand, attention has to be paid if there's at least one *outer* join in the query. Identities summarized in 'Valid OUTER JOIN Optimizations' section of optimizer/README come into play then. I think make_outerjoininfo() is the code to recognize these relationships in the original query, and join_is_legal() then to check if new joins (those not present in the original query) do not change the semantics. (As for set operations, someone else needs to explain.) // Antonin Houska (Tony) On 03/02/2014 09:02 AM, Ali Piroozi wrote: > Hi > > My question is: > Does PostgreSQL implements equivalence rules(from those are listed in > email's attachment)? > Which function or which part of source code(in PostgreSQL ) implements > the equivalence rules? > I think, this should be implemented in query optimization part of > PostgreSQL, but which rule > and where, I don't know? > I want to use that(function or part of source code), to produce the > equivalence Relational Algebras (based on equivalence rules in > attachment) for a given SQL query(Relational Algebra). > > Thanks > > > >