Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Heavily fragmen...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 9 Topic 15760 of 17437
Post > Topic >>

Heavily fragmented table and index data in 8.0.3

by zb@[EMAIL PROTECTED] (Zoltan Boszormenyi) Jun 6, 2008 at 04:35 PM

Hi,

we have a customer with PostgreSQL 8.0.3 with a quite interesting problem.
They have around 24 identical databases and all but one is working nicely.
The one that doesn't work nicely show this problem: INSERT "hangs"
on an apparently empty table where "select count(*)" returns 0 quite
quickly.

The relfilenodes of the table and its only (non-unique) index are below:

> ls -l ./17230/20387 ./17230/20382
-rw-------   1 postgres postgres 2727936 Jun  6 03:31 ./17230/20382
-rw-------   1 postgres postgres  630784 May 24 13:18 ./17230/20387

The machine is:

> uname -a
SunOS ihds00 5.10 Generic_125100-10 sun4u sparc SUNW,Netra-T12

The realtime trace I captured from the hung INSERT shows that it
enters two functions repeatedly: _bt_relandgetbuf() and _bt_compare().
The pattern in which these functions entered match either _bt_moveright()
or
_bt_insertonpg(). Also, VACUUM FULL also takes too much time,
on an otherwise idle database, I worked on a copy of their live database.
During VACUUM, _bt_getbuf() was also called repeatedly with the
block number jumping up and down. Obviously the table data is very
fragmented. The total database size is around 366MB, the only client
at the time was VACUUM, both the table and the index fit easily into
shared_buffers at the same time.

I know, 8.0.3 is quite old. But nothing jumped out from the changelog
up to 8.0.15 that would explain this excessive slowness. SELECTs are
pretty fast on any of the tables I tried, but INSERT hangs on this table.
How does this fragmentation happen and how can we prevent this situation?

Best regards,
Zoltán Böszörményi

-- 
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/


-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 9 Posts in Topic:
Heavily fragmented table and index data in 8.0.3
zb@[EMAIL PROTECTED] (Zo  2008-06-06 16:35:25 
Re: Heavily fragmented table and index data in 8.0.3
stark@[EMAIL PROTECTED]   2008-06-06 21:15:10 
Re: Heavily fragmented table and index data in 8.0.3
zb@[EMAIL PROTECTED] (Zo  2008-06-12 13:39:54 
Re: Heavily fragmented table and index data in 8.0.3
alvherre@[EMAIL PROTECTED  2008-06-12 10:30:20 
Re: Heavily fragmented table and index data in 8.0.3
tgl@[EMAIL PROTECTED] (T  2008-06-12 11:21:15 
Re: Heavily fragmented table and index data in 8.0.3
zb@[EMAIL PROTECTED] (Zo  2008-06-12 17:31:37 
Re: Heavily fragmented table and index data in 8.0.3
ajs@[EMAIL PROTECTED] (A  2008-06-12 11:56:28 
Re: Heavily fragmented table and index data in 8.0.3
tgl@[EMAIL PROTECTED] (T  2008-06-12 12:15:36 
Re: Heavily fragmented table and index data in 8.0.3
jd@[EMAIL PROTECTED] (&q  2008-06-12 09:02:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 12:24:07 CST 2008.