Re: Optimizer internals - Mailing list pgsql-performance

From Mischa Sandberg
Subject Re: Optimizer internals
Date
Msg-id 4491FD06.50901@ca.sophos.com
Whole thread Raw
In response to Re: Optimizer internals  (Mark Lewis <mark.lewis@mir3.com>)
List pgsql-performance
Mark Lewis wrote:
> On Thu, 2006-06-15 at 14:05 -0400, John Vincent wrote:
>> Now I've been told by our DBA that we should have been able to wholy
>> satisfy that query via the indexes.

> DB2 can satisfy the query using only indexes because DB2 doesn't do
> MVCC.

You can get pretty much the same effect with materialized views.
Create a table that LOOKS like the index (just those columns),
with a foreign key relationship to the original table (cascade delete),
and have the after-insert trigger on the main table write a row to the derived table.
Now (index and) query the skinny table.

Advantage of these tables: you can cluster them regularily,
because it doesn't hard-lock the main table.

--
Engineers think that equations approximate reality.
Physicists think that reality approximates the equations.
Mathematicians never make the connection.

pgsql-performance by date:

Previous
From: "Alex Turner"
Date:
Subject: Re: SAN performance mystery
Next
From: "Merlin Moncure"
Date:
Subject: Re: Performance of pg_dump on PGSQL 8.0