Re: Visibility map thoughts

From: Mark Mielke <mark(at)mark(dot)mielke(dot)cc>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Visibility map thoughts
Date: 2007-11-06 14:21:00
Message-ID: 4730784C.7020004@mark.mielke.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs wrote:
> On Tue, 2007-11-06 at 13:29 +0000, Heikki Linnakangas wrote:
>
>> And of course people will start adding columns to indexes, to make use
>> of index-only-scans, once we have the capability.
>>
> Not too keen on that. Very difficult to judge whether its worth the
> benefit for creating lots of extra columns in indexes. Specifically,
> this isn't going to speed up any existing application without additional
> design work.
>
> But seems like we have reasonable reason for them without that.
>
> Do we know how much faster things might go if we do that?
>
Effectively - you get a materialized view with limitations (no joins or
calculations), with rows in B-Tree order. Update speed would suffer, but
I would expect nearly all random access queries to improve, and the
fewer the columns included in the index, the less data that needs to be
scanned to find the data you want.

I have some data that might benefit. For example, on one system I
synchronize data from ACCPAC on MSSQL into PGSQL, then use only a subset
of the columns in the ACCPAC tables in my PGSQL queries.

I say might, because the ACCPAC data is so sprawled out that my
"materialized view" does significant calculation calculating aggregates
and fields with conditional values. The ACCPAC query based entirely on a
view takes over 1 second to run. The query on the "materialized view"
row takes 0.01 seconds. Quite a difference. :-)

Cheers,
mark

--
Mark Mielke <mark(at)mielke(dot)cc>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-11-06 14:34:42 Re: Hash index todo list item
Previous Message Heikki Linnakangas 2007-11-06 14:18:21 Re: Visibility map thoughts