From: | Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com> |
---|---|
To: | Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> |
Cc: | Simon Riggs <simon(at)2ndQuadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Index-only scans |
Date: | 2009-07-15 00:21:26 |
Message-ID: | 4A5D2106.4040508@cheapcomplexdevices.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 manytomany order 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Jeremy Kerr | 2009-07-15 00:42:07 | Re: [PATCH 1/2 v3] [libpq] rework sigpipe-handling macros |
Previous Message | Robert Haas | 2009-07-15 00:18:03 | CommitFest 2009-07 is Now Closed |