Index only scan - Mailing list pgsql-general

From Lars Helge Øverland
Subject Index only scan
Date
Msg-id CAD_DPKw_M7xkqzjF_qrXSPAzw6bYCm8y+qrvjJ2p5c-5SsAu7w@mail.gmail.com
Whole thread Raw
Responses Re: Index only scan  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
Re: Index only scan  (Ondrej Ivanič <ondrej.ivanic@gmail.com>)
List 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


pgsql-general by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: libpq-how to add a schema to search path
Next
From: Shaun Thomas
Date:
Subject: Re: Storing large files in multiple schemas: BLOB or BYTEA