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

Поиск
Список
Период
Сортировка
От Ashutosh Bapat
Тема Re: [HACKERS] How does postgres store the join predicate for arelation in a given query
Дата
Msg-id CAFjFpRfVh85rbVLsF9WNzoYdmX1fhRE9Kjuz4bQ2RRUtcFBRBQ@mail.gmail.com
обсуждение исходный текст
Ответ на [HACKERS] How does postgres store the join predicate for a relation in a given query  (Gourav Kumar <gourav1905@gmail.com>)
Ответы Re: [HACKERS] How does postgres store the join predicate for arelation in a given query  (Gourav Kumar <gourav1905@gmail.com>)
Список pgsql-hackers
On Tue, Oct 10, 2017 at 7:29 PM, Gourav Kumar <gourav1905@gmail.com> wrote:
> Hi all,
>
> 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 ?
>

Every relation has a RelOptInfo associated with it. Predicates
applicable to it are stored in this RelOptInfo as a list. For base
relations (simple tables) it's in baserestrictinfo. The join
predicates applicable are in joininfo. You can get RelOptInfo of a
given simple table using find_base_rel().

HTH.


-- 
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company


-- 
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 по дате отправления:

Предыдущее
От: Jeremy Schneider
Дата:
Сообщение: Re: [HACKERS] show precise repos version for dev builds?
Следующее
От: Masahiko Sawada
Дата:
Сообщение: Re: [HACKERS] Slow synchronous logical replication