Re: pg_attribute - Index

From: kris pal <kristhegambler(at)yahoo(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_attribute - Index
Date: 2004-08-30 15:41:58
Message-ID: 20040830154158.56369.qmail@web52806.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Thanks to everyone who helped.
Chris, as you said, reading several GB (abt 3 GB) and writing out the data was causing a huge I/O Wait and this caused the heavy load on the server. I tried to Vacuum and even after 40 mins it was still running. Was not sure how much longer it was going to take. I had only a one hour scheduled down time.

So, I finally had to drop and reimport the database - it took less than 15 mins for all of this. Its good now. And I will Vacuum it regulary now.

1) Even if I vacuum regularly, the index "pg_attribute_relid_attnam_index" is growing very fast because of huge data loads and deletes.

What is the easiest way to REINDEX system catalog indexes ? (I couldn't drop it even in single user mode).

thanks,
Kris Pal.

Christopher Browne <cbbrowne(at)acm(dot)org> wrote:After a long battle with technology, kristhegambler(at)yahoo(dot)com (kris pal), an earthling, wrote:
>
>
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>> 1) Can you tell me if there is any other work around to vacuum the
>>> pg_attribute system table ? Like doing it in parts so that it won't
>> >cause a high load.
>
> Chris Browne wrote:
>>No, you need to let the vacuum finish.
>>If you stop it early, it'll just increase system load and accomplish _nothing_.
>
>>>>>>>>>>>>>>>>>>>>>>>>>>

> But while doing vacuum the load is getting so high that the system
> is almost freezing.

Right. You said that the table was consuming 2GB of space. It has to
read in that 2GB, and discard the bits that aren't necessary.

> Does the performance of 'Vacuum' command depend on other system/
> database parameters? The 'vacuum pg_attribute" command never
> completes, its causing high load on the server. I had to wait for 15
> mins and kill it. Because the system load was touching 10, slowing
> down the system therefore not letting anyone access the server.

What's happening, is, at root, that the vacuum process loads all the
data in the table (2GB, you indicated) into memory, looks at it, and
writes it back out.

That presumably leads to about 2GB of reads and 2GB of writes, which
takes a while.

If you want this to go as quickly as possible, shut the database down
and start the postmaster in single user mode so that there's no other
activity competing for the system's resources.

> Can we vacuum the "pg_attribiute" in parts? So that 'vacuum' will
> complete faster and there won't be load issues. Thanks Tom Lane and
> Chris Browne for your help so far.

As I said, no, you need to let the vacuum finish. It's one table, and
must be vacuumed in one piece. If you stop it early, you're just
wasting your time. You cannot do it in pieces, and if you did, that
wouldn't make it complete faster anyways. That would make it take
MORE time.

Do the vacuum, and hold on until it is done.

Once that vacuum is done, later vacuums will take place MUCH quicker,
and in that you are clearly making enormous numbers of modifications
to the table, you need to vacuum the table regularly.
--
select 'cbbrowne' || '@' || 'ntlug.org';
http://cbbrowne.com/info/spiritual.html
Real Programmers use: "compress -d > a.out"

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2004-08-30 16:37:01 Re: pg_attribute - Index
Previous Message Tom Lane 2004-08-28 16:54:15 Re: Postgresql Server Restart continuously