better approach: case or join

Поиск
Список
Период
Сортировка
От chester c young
Тема better approach: case or join
Дата
Msg-id 828472.77350.qm@web54308.mail.yahoo.com
обсуждение исходный текст
Список pgsql-sql
from id extracting name from several tables.  which is generally the
better approach?

select case when tab_tla='usr' then (select name from users where ... )      case when tab_tla='con' then (select title
fromcontents where
 
...)
end    as name;

as versus

select  name
from    users
where   tab_tla='usr' and ...       join
select  title
from    contents
where   tab_tla='con' and ...

I assume the former since the optimizer does not examine whether the
entire where clause might be false before executing the query.

thanks,
chester


____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html 


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

Предыдущее
От: T E Schmitz
Дата:
Сообщение: triple self-join crawling
Следующее
От: roopa perumalraja
Дата:
Сообщение: Help with sub query