Thread: Table Bloat still there after the Vacuum
In response to akp geek <akpgeek@gmail.com>: > Hi All - > > I have a table bloated with following details > rows:29431 pages:516039 shouldbe:534 (966.4X) wasted size:4223016960 (3 GB) > * > > I did a vacuum on the database and also I did vacuumdb > full on the table. Still there is no change. Can you please suggest if there > is any other operation that can be done to take care of the issue VACUUM doesn't guarantee that it will clean all the bloat out, it makes some effort to debloat, but that's not its primary function. VACUUM FULL will completely debloat a table, contingent on restrictions below. Is that what you're running? I'm a little confused by your comment "vacuumdb full on the table" which contradicts itself. Please provide the exact commands that your ran, along with the output that resulted. Neither type of VACUUM can debloat rows that are still in use by transactions. If the applications that connect to this database are keeping transactions open for long periods, it will adversely affect those commands' ability to clean up dead rows. There is much more here: http://www.postgresql.org/docs/8.4/static/routine-vacuuming.html -- Bill Moran http://www.potentialtech.com http://people.collaborativefusion.com/~wmoran/
2010/4/26 akp geek <akpgeek@gmail.com>: > Hi All - > I have a table bloated with following details > rows:29431 pages:516039 shouldbe:534 (966.4X) wasted size:4223016960 (3 GB) > * I think this info come from check_postgres nagios script. As said in the doc, this info is not 100% sure : it depend on the last analyze *and* the type the columns *and* the distribution of data in those columns. I suggest you to check the pg_stats.avg_width relative to this table. And, vacuum verbose information is good for diagnostics... > I did a vacuum on the database and also I did vacuumdb > full on the table. Still there is no change. Can you please suggest if there > is any other operation that can be done to take care of the issue > Thanks for the help > > Regards -- Cédric Villemain
Regards
In response to akp geek <akpgeek@gmail.com>:VACUUM doesn't guarantee that it will clean all the bloat out, it makes
> Hi All -
>
> I have a table bloated with following details
> rows:29431 pages:516039 shouldbe:534 (966.4X) wasted size:4223016960 (3 GB)
> *
>
> I did a vacuum on the database and also I did vacuumdb
> full on the table. Still there is no change. Can you please suggest if there
> is any other operation that can be done to take care of the issue
some effort to debloat, but that's not its primary function.
VACUUM FULL will completely debloat a table, contingent on restrictions
below. Is that what you're running? I'm a little confused by your
comment "vacuumdb full on the table" which contradicts itself. Please
provide the exact commands that your ran, along with the output that
resulted.
Neither type of VACUUM can debloat rows that are still in use by
transactions. If the applications that connect to this database are
keeping transactions open for long periods, it will adversely affect
those commands' ability to clean up dead rows.
There is much more here:
http://www.postgresql.org/docs/8.4/static/routine-vacuuming.html
--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/
2010/4/26 Cédric Villemain <cedric.villemain.debian@gmail.com>: > 2010/4/26 akp geek <akpgeek@gmail.com>: >> Hi All - >> I have a table bloated with following details >> rows:29431 pages:516039 shouldbe:534 (966.4X) wasted size:4223016960 (3 GB) >> * > > I think this info come from check_postgres nagios script. > As said in the doc, this info is not 100% sure : it depend on the last > analyze *and* the type the columns *and* the distribution of data in > those columns. > I suggest you to check the pg_stats.avg_width relative to this table. > > And, vacuum verbose information is good for diagnostics... and the verbose said there is actually a problem :-) check long running transaction, idle in connection, ... they prevent the vacuum things > >> I did a vacuum on the database and also I did vacuumdb >> full on the table. Still there is no change. Can you please suggest if there >> is any other operation that can be done to take care of the issue >> Thanks for the help >> >> Regards > > > > -- > Cédric Villemain > -- Cédric Villemain
akp geek <akpgeek@gmail.com> writes: > * "Orders": found 0 removable, 27164544 nonremovable row versions in 518971 > pages* > *DETAIL: 27126176 dead row versions cannot be removed yet.* So there isn't anything vacuum can do right now. You've apparently got an old open transaction, which is blocking vacuum from removing those dead rows because the open transaction should still be able to see them if it were to look. You need to close that transaction, and then do a vacuum full (and probably a reindex after that). regards, tom lane
pgsql-general-owner@postgresql.org wrote on 04/26/2010 03:43:03 PM:
> Hi All -
>
> I have a table bloated with following details
> rows:29431 pages:516039 shouldbe:534 (966.4X) wasted size:4223016960(3 GB) *
>
> I did a vacuum on the database and also I did
> vacuumdb full on the table. Still there is no change. Can you please
> suggest if there is any other operation that can be done to take
> care of the issue
>
> Thanks for the help
>
> Regards
Try a CLUSTER (http://www.postgresql.org/docs/8.4/static/sql-cluster.html) that will physically rewrite the table.
However note it will require an Access Exclusive lock on the table preventing any other activity on the table.
Chris Ellis
******************************************************************************
If you are not the intended recipient of this email please do not send it on
to others, open any attachments or file the email locally.
Please inform the sender of the error and then delete the original email.
For more information, please refer to http://www.shropshire.gov.uk/privacy.nsf
******************************************************************************
Help prevent the spread of swine flu. CATCH IT. BIN IT. KILL IT.
******************************************************************************
Regards
pgsql-general-owner@postgresql.org wrote on 04/26/2010 03:43:03 PM:
> Hi All -Try a CLUSTER (http://www.postgresql.org/docs/8.4/static/sql-cluster.html) that will physically rewrite the table.>
> I have a table bloated with following details
> rows:29431 pages:516039 shouldbe:534 (966.4X) wasted size:4223016960(3 GB) *
>
> I did a vacuum on the database and also I did
> vacuumdb full on the table. Still there is no change. Can you please
> suggest if there is any other operation that can be done to take
> care of the issue
>
> Thanks for the help
>
> Regards
However note it will require an Access Exclusive lock on the table preventing any other activity on the table.
Chris Ellis******************************************************************************
If you are not the intended recipient of this email please do not send it on
to others, open any attachments or file the email locally.
Please inform the sender of the error and then delete the original email.
For more information, please refer to http://www.shropshire.gov.uk/privacy.nsf
******************************************************************************
Help prevent the spread of swine flu. CATCH IT. BIN IT. KILL IT.
******************************************************************************