Re: broken join optimization? (8.0)

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: broken join optimization? (8.0)
Дата
Msg-id 435F3EF4.7010808@archonet.com
обсуждение исходный текст
Ответ на broken join optimization? (8.0)  (chester c young <chestercyoung@yahoo.com>)
Список pgsql-sql
chester c young wrote:
> in php (for example) it's frequently nice to get the structure of a
> table without any data, ie, pull a single row with each attribute's
> value is null.  I use the query (dual is a table of one row ala
> Oracle):
> 
> select m.* from dual
> left join mytable m on( false );

Out of curiosity, why do it this way? Does "rownum" not get set if there 
are no rows returned?

Actually, even if it doesn't why not use:  SELECT * FROM mytable WHERE true=false

Surely your client interface returns the types/column-names then? It 
should - that's a set of 0 rows.

--  Richard Huxton  Archonet Ltd


В списке pgsql-sql по дате отправления:

Предыдущее
От: Patrick JACQUOT
Дата:
Сообщение: Re: automatic update or insert
Следующее
От: Rajesh Kumar Mallah
Дата:
Сообщение: converting epoch to timestamp