Thread: nonremovable row versions

nonremovable row versions

From
Lutz Steinborn
Date:
Hi,

can anybody tell me how to get rid of nonremovable row versions ?
I know what those rows coming from long running transactions. But I can't see
any long running transactions in pg_locks and all postgres processes are idle.
How else can I check if transaction in process ?


I don't have any idea from where those long running transaction are comming
because we are stopping/starting our apllications every 2-3 days. And its not
the nature of our applications to establish long running transactions.

We are using postgresql 8.1.4.

Kindly regards
Lutz
4c GmbH

Re: nonremovable row versions

From
Scott Marlowe
Date:
On Mon, Jun 8, 2009 at 12:28 AM, Lutz Steinborn<l.steinborn@4c-ag.de> wrote:
> Hi,
>
> can anybody tell me how to get rid of nonremovable row versions ?
> I know what those rows coming from long running transactions. But I can't see
> any long running transactions in pg_locks and all postgres processes are idle.
> How else can I check if transaction in process ?
>
>
> I don't have any idea from where those long running transaction are comming
> because we are stopping/starting our apllications every 2-3 days. And its not
> the nature of our applications to establish long running transactions.

I think you misunderstand nonremoveable rows.  A demonstration:

postgres=# create table test (id int);
CREATE TABLE
postgres=# insert into test values (1),(2),(3);
INSERT 0 3
postgres=# vacuum verbose test;
INFO:  vacuuming "public.test"
INFO:  "test": found 0 removable, 3 nonremovable row versions in 1 pages
DETAIL:  0 dead row versions cannot be removed yet.
There were 0 unused item pointers.
1 pages contain useful free space.
0 pages are entirely empty.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
VACUUM

It's not just old transactions, it's current data as well.

>
> We are using postgresql 8.1.4.

You really should be running 8.1.17.

Re: nonremovable row versions

From
Brad Nicholson
Date:
On Mon, 2009-06-08 at 01:14 -0600, Scott Marlowe wrote:
> On Mon, Jun 8, 2009 at 12:28 AM, Lutz Steinborn<l.steinborn@4c-ag.de> wrote:
> > Hi,
> >
> > can anybody tell me how to get rid of nonremovable row versions ?
> > I know what those rows coming from long running transactions. But I can't see
> > any long running transactions in pg_locks and all postgres processes are idle.
> > How else can I check if transaction in process ?
> >
> >
> > I don't have any idea from where those long running transaction are comming
> > because we are stopping/starting our apllications every 2-3 days. And its not
> > the nature of our applications to establish long running transactions.
>
> I think you misunderstand nonremoveable rows.  A demonstration:
>
> postgres=# create table test (id int);
> CREATE TABLE
> postgres=# insert into test values (1),(2),(3);
> INSERT 0 3
> postgres=# vacuum verbose test;
> INFO:  vacuuming "public.test"
> INFO:  "test": found 0 removable, 3 nonremovable row versions in 1 pages
> DETAIL:  0 dead row versions cannot be removed yet.
> There were 0 unused item pointers.
> 1 pages contain useful free space.
> 0 pages are entirely empty.
> CPU 0.00s/0.00u sec elapsed 0.00 sec.
> VACUUM
>
> It's not just old transactions, it's current data as well.

I've seen cases in 8.1 where the information pg_stat_activity is
incorrectly report a transaction as "<IDLE>" when it is in fact blocking
the removal of dead tuples.

I always chalked it up to inaccuracy of the stats collector in 8.1.
--
Brad Nicholson  416-673-4106
Database Administrator, Afilias Canada Corp.