Re: why does this select hang postgres???

Поиск
Список
Период
Сортировка
От
Тема Re: why does this select hang postgres???
Дата
Msg-id Pine.LNX.4.30.0108101106280.22311-100000@commandprompt.com
обсуждение исходный текст
Ответ на Re: why does this select hang postgres???  (<pgsql-general@commandprompt.com>)
Список 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 по дате отправления:

Предыдущее
От:
Дата:
Сообщение: Boolean Constants Implicit?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: why does this select hang postgres???