Re: Which file does the SELECT? - Mailing list pgsql-hackers

From Vaibhav Kaushal
Subject Re: Which file does the SELECT?
Date
Msg-id AANLkTimvbFDsQqt_yxcFxspsiRbMaFig5cz05-tqmBMo@mail.gmail.com
Whole thread Raw
In response to Re: Which file does the SELECT?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Which file does the SELECT?
Re: Which file does the SELECT?
List pgsql-hackers
Thanks to both hitoshi and tom for your replies. 

I think I need to look into the Postgres code itself (I am better at code than documentation). But since I have not been touch with C lately (these days I am programming on PHP) I think I have forgot a few rules of game (afterall PHP is so much more easy than C :P ). Moreover,  postgres is the first Open Source software whose code I am interested in. I have never looked into other OSS codes much except correcting a few compilation errors here and there on beta / alpha releases. 

I have had the chance and success to compile my own Linux OS and it was fun to do so... but I guess development is a tougher job. With an idea in mind, and a thankful feeling towards postgres is what drives me to do this tougher job.

When I was designing my database for a web app, I found so many problems in MySQL that I could not continue (the best of all, I can't use the commands written in my DB book to create a foreign key, it does not natively support foreign keys, confusing storage engines and so on).. and then I got postgres which I am a fan of.

I hope I will not be flamed when I will ask those questions (some of them are actually very silly ones). 

 I will look inside the code now and will get back after i get some progress with it.

However, I find too many references to the Data structure "datum" what is it and where is it defined? Can someone tell me please? Also, what role does it play?

Thanks to you all for your replies.

-Vaibhav



On Sun, Oct 10, 2010 at 9:29 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Vaibhav Kaushal <vaibhavkaushal123@gmail.com> writes:
> Can someone tell me what are 'Join Pairs with no Join clause' ? I am not
> able to figure that out!

Consider

       select * from t1, t2, t3 where t1.a = t2.x and t1.b = t3.y;

In theory this query could be done by first joining t2 and t3, then
joining that to t1.  But the planner won't investigate the possibility
because the t2/t3 join would have to be a cartesian product join:
there's no WHERE clause relating them.

On the other hand, if we have

       select * from t1, t2, t3 where t1.a = t2.x and t1.a = t3.y;

then the planner is able to infer the additional join clause t2.x =
t3.y, so it will consider that join sequence.

                       regards, tom lane

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Which file does the SELECT?
Next
From: Tom Lane
Date:
Subject: Re: WIP: Triggers on VIEWs