broken join optimization? (8.0)

Поиск
Список
Период
Сортировка
От chester c young
Тема broken join optimization? (8.0)
Дата
Msg-id 20051025235612.20767.qmail@web54301.mail.yahoo.com
обсуждение исходный текст
Ответы Re: broken join optimization? (8.0)
Re: broken join optimization? (8.0)
Список pgsql-sql
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 );

this works every time, but if mytable is big, then takes a long time. 
needed to rewrite the query to:

select m.* from dual
left join (select * from mytable limit 1) m on( false );

this works as it should - pulls empty row but fast.

it seems to me that a full table scan should not be necessary if the
join condition is false.


    
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs


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

Предыдущее
От: Judith Altamirano Figueroa
Дата:
Сообщение: backend error
Следующее
От: "Bath, David"
Дата:
Сообщение: ?Equiv to oracle (ENABLE|DISABLE) (CONSTRAINT|TRIGGER) statements?