Views and unique indicies optimisation

Поиск
Список
Период
Сортировка
От Robert Osowiecki
Тема Views and unique indicies optimisation
Дата
Msg-id 8646.1044902158.zmok@sepulka.mimuw.edu.pl
обсуждение исходный текст
Список pgsql-hackers
Here's an example:
create view master_detailas select * from master left join detail on (master.detail_key=detail.key);

I noticed that PostgreSQ performs join even when I execute
select some_master_fields from master_detail;

but there exists an unique index on detail.key, so above query
gives the same result as
select some_master_fields from master;

but with much loss in performance, of course.

This problem emerged when I replaced renundant table in poorly
designed database with two tables, view and set of rules.
I thought that I was very clever, because I didn't have to 
replace any code in applications using this database, but
it seems that there's always a catch...

May I have hope that such optimisation will be included in
TODO list in near future?

--   <><><><><><><><><><><><><><><><><><><><><>  <>      magic.robson@rassun.art.pl      <>  <>
http://rainbow.mimuw.edu.pl/~robson<>  <><><><><><><><><><><><><><><><><><><><><>
 


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: location of the configuration files
Следующее
От: "Joe Hellerstein"
Дата:
Сообщение: Berkeley and CMU classes adopt/extend PostgreSQL