Re: Improvement of procArray.xmin for VACUUM - Mailing list pgsql-patches

From Alvaro Herrera
Subject Re: Improvement of procArray.xmin for VACUUM
Date
Msg-id 20070323211314.GD4507@alvh.no-ip.org
Whole thread Raw
In response to Improvement of procArray.xmin for VACUUM  (Bruce Momjian <bruce@momjian.us>)
List pgsql-patches
Bruce Momjian wrote:

> The attached patch updates procArray.xmin in this manner.  Here is an
> example of how the patch improves dead row reuse:

I don't think this really works.  Consider what happens if I change
session 2 this way:

> Session #:
>         1                               2               3
>
>         CREATE TABLE test(x int);
>         INSERT INTO test VALUES (1);
>         BEGIN;
>         DELETE FROM test;
>                                         BEGIN;
                                          DECLARE foo CURSOR FOR
                      SELECT * FROM test;
>                                         SELECT 1;
>         COMMIT;
>                                                         VACUUM VERBOSE test;
>                                                         (row not reused)
>                                         SELECT 1;
                                          FETCH * FROM foo;
>
>                                         (At this point #2 doesn't see
>                                          the test row anymore.  Patch
>                                          updates procArray.xmin.)
>
>                                                         VACUUM VERBOSE test;
>                                                         (row reused with patch)
>                                         COMMIT;
>                                                         VACUUM VERBOSE test;
>                                                         (normal row reuse)


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

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Improvement of procArray.xmin for VACUUM
Next
From: Tom Lane
Date:
Subject: Re: Improvement of procArray.xmin for VACUUM