Re: Index-only scans
От | Ron Mayer |
---|---|
Тема | Re: Index-only scans |
Дата | |
Msg-id | 4A5D2106.4040508@cheapcomplexdevices.com обсуждение исходный текст |
Ответ на | Re: Index-only scans (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>) |
Ответы |
Re: Index-only scans
|
Список | 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 по дате отправления: