Views and unique indicies optimisation - Mailing list pgsql-hackers

From Robert Osowiecki
Subject Views and unique indicies optimisation
Date
Msg-id 8646.1044902158.zmok@sepulka.mimuw.edu.pl
Whole thread Raw
List 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 by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: location of the configuration files
Next
From: "Joe Hellerstein"
Date:
Subject: Berkeley and CMU classes adopt/extend PostgreSQL