Re: why does this select hang postgres??? - Mailing list pgsql-general

From
Subject Re: why does this select hang postgres???
Date
Msg-id Pine.LNX.4.30.0108101106280.22311-100000@commandprompt.com
Whole thread Raw
In response to Re: why does this select hang postgres???  (<pgsql-general@commandprompt.com>)
List pgsql-general
On Fri, 10 Aug 2001 pgsql-general@commandprompt.com wrote:
>On Fri, 10 Aug 2001, Jeremy Hansen wrote:
>>select * from env_info,summary,plat_info;
>>Is my statement broken?  Is this not legal?  Postgres just sits there....
>Well, without a JOIN or a WHERE clause, this query is going to try create
>the raw cartesian product of the two tables.

Er, thought that was a dot. Make that three tables, even worse if these
are even large-ish tables.

I have no idea what your table structure is like, but assuming there is
some sort of relation between these tables, you'd really want to do
something like:

SELECT * FROM env_info INNER JOIN summary
           ON (env_info.id=summary.id) INNER JOIN plat_info
           ON (env_info.id=plat_info.id);

If there's no relationship between these tables, alternatively, I'm not
sure what you're trying to accomplish. ;)



Regards,
Jw.
--
jlx@commandprompt.com by way of pgsql-general@commandprompt.com



pgsql-general by date:

Previous
From:
Date:
Subject: Boolean Constants Implicit?
Next
From: Bruce Momjian
Date:
Subject: Re: why does this select hang postgres???