From: | Lars Helge Øverland <larshelge(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Index only scan |
Date: | 2012-10-10 12:03:57 |
Message-ID: | CAD_DPKw_M7xkqzjF_qrXSPAzw6bYCm8y+qrvjJ2p5c-5SsAu7w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi all,
first of all thanks for the great new "index only scan" feature in
9.2. We have managed to adapt our app (dhis2.org) to take advantage of
it and it really speeds up several queries significantly.
We are now in the process of designing a new component for analytics
and this feature got me thinking we could utilize postgres over other
alternatives like column-oriented databases. Basically we will have a
wide, denormalized table with 20+ columns with relatively low
cardinality. Typically we will have queries which sums a fact column
based on where/group by clauses on several dimension columns (standard
data warehouse stuff). An example would be "select a, b, c, sum(d)
from analytics where a=1 and b=2 group by a,b,c";
Now my initial idea was to simply put a single index on all of those
columns, in the hope that "index only scans" would kick in. It seems
this is not the case, as strictly one (single or multi-column) index
is required to enable index only scans for a query.
My question is: Would it be feasible and/or possible to implement
index only scans in a way that it could take advantage of several,
single-column indexes? For example, a query spanning columns a, b, c
could take advantage of 3 single-column indexes put on columns a, b,
c.
Finally, is there anyone else who are using postgres for this purpose
and have some good tips to share in order to achieve good performance,
including index strategies, beyond the standard config best practices?
best regards,
Lars Helge Øverland
From | Date | Subject | |
---|---|---|---|
Next Message | Shaun Thomas | 2012-10-10 12:56:15 | Re: Storing large files in multiple schemas: BLOB or BYTEA |
Previous Message | Noah Misch | 2012-10-10 11:05:55 | Re: BUG #6510: A simple prompt is displayed using wrong charset |