Re: postgres optimizer

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Hossein S(dot) Attar" <mhsheikh(at)softbase(dot)math(dot)uwaterloo(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: postgres optimizer
Date: 2005-08-26 15:18:51
Message-ID: 9267.1125069531@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Hossein S. Attar" <mhsheikh(at)softbase(dot)math(dot)uwaterloo(dot)ca> writes:
> I am working on postgres optimizer code to add some statistics
> collection features for an academic project. At some point in my work, I
> need to be able to tell if a join is a foreign key join or not. Also in
> case of a foreign key join, I need to identify which input to the join
> operator has the primary key attribute and which one has teh foreign
> key. In other words, when we are making a JoinPath struct, I need to
> identify if the join between the inner and outer RelOptInfo structs is a
> foreign key join and if so, which RelOptInfo has the primary key. Does
> anyone know the best way to do this? Should I go to "joinrestrictinfo"
> field and go over all expressions? Is there any easier way?

The planner doesn't think there is any such thing as a "foreign key
join". Perhaps you should modify the foreign key triggers (in
ri_triggers.c) to collect the information you need.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2005-08-26 15:19:20 Re: Problems Reinstalling PostgreSQL on XP
Previous Message Martijn van Oosterhout 2005-08-26 15:06:41 Re: Resore PG-Data from Files after crash