Re: Preventing index scans for non-recoverable index AMs - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Preventing index scans for non-recoverable index AMs
Date
Msg-id 20081218022846.GN4453@alvh.no-ip.org
Whole thread Raw
In response to Re: Preventing index scans for non-recoverable index AMs  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Preventing index scans for non-recoverable index AMs
List pgsql-hackers
Simon Riggs wrote:
> 
> On Wed, 2008-12-17 at 21:23 -0300, Alvaro Herrera wrote:

> > Maybe we should add a WAL record that's the physical representation for
> > "mark this index invalid", and have any transaction that modifies a hash
> > index write that to WAL.  It should be simple code to write, because
> > the underlying replay is based on a regular heap update.
> 
> Doesn't sound like it would work. It doesn't really matter how you
> *decide* to do this, it's when you do this that counts.

Hmm, it doesn't seem like you understood my suggestion ... basically I'm
saying that a hash index insert/delete should put out this WAL record:

HEAP update address-of-pg_index-tuple set indisvalid=false

(I'm just guessing at indisvalid but you get my point)

No need to remember anything.  Of course, the user then needs to fix the
index after the fact.

Of course, for 8.5 we would do something smarter.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Preventing index scans for non-recoverable index AMs
Next
From: Alvaro Herrera
Date:
Subject: Re: [PATCHES] Infrastructure changes for recovery (v8)