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.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to