Re: [HACKERS] How does postgres store the join predicate for arelation in a given query

Поиск
Список
Период
Сортировка
От Nico Williams
Тема Re: [HACKERS] How does postgres store the join predicate for arelation in a given query
Дата
Msg-id 20171010175132.GB3813@localhost
обсуждение исходный текст
Ответ на [HACKERS] How does postgres store the join predicate for a relation in a given query  (Gourav Kumar <gourav1905@gmail.com>)
Список pgsql-hackers
On Tue, Oct 10, 2017 at 07:29:24PM +0530, Gourav Kumar wrote:
> When you fire a query in postgresql, it will first parse the query and
> create the data structures for storing various aspects of the query and
> executing the query. (Like RangeTblEntry, PlannerInfo, RangeOptInfo etc.).
> 
> I want to know how does postgresql stores the join predicates of a query.
> Like which data structure is used to store the join predicates.
> 
> How can we find the join predicates applied on a relation from relid, Oid
> or RangeTblEntry ?
> 
> I want to construct a join graph for a given query, for which I need the
> join predicates between two relations.

In the usingClause or quals fields of a JoinExpr.  See
src/backend/parser/gram.y, search for join_qual.

Of course, WHERE clauses have to be inspected as well, which go into the
whereClause of of a SelectStmt; search for where_clause in
src/backend/parser/gram.y.

Nico
-- 


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Aleksander Alekseev
Дата:
Сообщение: [HACKERS] Re: [BUGS] 10.0: Logical replication doesn't execute BEFORE UPDATEOF trigger
Следующее
От: Petr Jelinek
Дата:
Сообщение: [HACKERS] Re: [BUGS] 10.0: Logical replication doesn't execute BEFORE UPDATE OF trigger