Re: Index-only scans - Mailing list pgsql-hackers

From Ron Mayer
Subject Re: Index-only scans
Date
Msg-id 4A5D2106.4040508@cheapcomplexdevices.com
Whole thread Raw
In response to Re: Index-only scans  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Index-only scans
List pgsql-hackers
Heikki Linnakangas wrote:
> ...
> CREATE TABLE manytomany (aid integer, bid integer);
> CREATE INDEX a_b ON manytomany (aid, bid);
> CREATE INDEX b_a ON manytomany (bid, aid);
> ...
>> new and interesting indexing strategies. Covered indexes are also one
>> kind of materialized view. It may be better to implement mat views and
>> gain wider benefits too.
> 
> Materialized view sure would be nice, but doesn't address quite the same
> use cases. Doesn't help with the many-to-many example above, for
> example. We should have both.

Really?  I'd have thought that index is similar to materializing
these views: create view a_b as select aid,bid from manytomany order by aid,bid; create view b_a as select bid,aid from
manytomanyorder by bid,aid;
 
Or perhaps create view a_b as select aid,array_agg(bid) from manytomany group by aid;


But I like the index-only scan better anyway because I already have
the indexes so the benefit would come to me automatically rather than
having to pick and choose what views to materialize.



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: CommitFest 2009-07 is Now Closed
Next
From: Glen Parker
Date:
Subject: Re: more than one index in a single heap pass?