Thread: abnormal size of the on-disk file.

abnormal size of the on-disk file.

From
Rajesh Kumar Mallah
Date:
Hi There, <p>I have a small table  companies (< 300 rows)  and its on-disk size shows <br />abnormal <br />  <p>i
checkit as follows: <p><tt><font size="-1"> SELECT relname,relfilenode  from pg_class where
relfilenode=30977;</font></tt><br/><tt><font size="-1">  relname  | relfilenode</font></tt><br /><tt><font
size="-1">-----------+-------------</font></tt><br/><tt><font size="-1"> companies |       30977</font></tt><br
/><tt><fontsize="-1">(1 row)</font></tt><p><tt><font size="-1">ls -lsh  30977</font></tt><br /><tt><font size="-1">487M
-rw-------   1 postgres postgres     <b><font color="#CC0000">486M</font></b> Apr 26 20:27 30977</font></tt><br
/><tt><fontsize="-1">bash-2.03$</font></tt><br />  <p>i created a new table with the same content <p><tt><font
size="-1">tradein_clients=>CREATE  TABLE t_a as select * from companies;</font></tt><tt><font
size="-1"></font></tt><p><tt><fontsize="-1">SELECT</font></tt><p>its on disk file is very small <p><tt><font
size="-1">tradein_clients=>SELECT relname,relfilenode  from pg_class where relname='t_a';</font></tt><br /><tt><font
size="-1"> relname| relfilenode</font></tt><br /><tt><font size="-1">---------+-------------</font></tt><br /><tt><font
size="-1"> t_a    |    87812505</font></tt><br /><tt><font size="-1">(1 row)</font></tt><p><tt><font
size="-1">bash-2.03$ls -lsh  87812505</font></tt><br /><tt><font size="-1">196k -rw-------    1 postgres postgres    
<b><fontcolor="#000099">192k</font></b> Apr 26 20:27 87812505</font></tt><br /><tt><font
size="-1">bash-2.03$</font></tt><tt><fontsize="-1"></font></tt><p>Can anyone explain this .. <p>does unvaccuming makes
tables x2000  times largers?? <p>regds <br />mallah. 

Re: abnormal size of the on-disk file.

From
Stephan Szabo
Date:
On Fri, 26 Apr 2002, Rajesh Kumar Mallah wrote:

> Hi There,
>
> I have a small table  companies (< 300 rows)  and its on-disk size shows
> abnormal


If you've been making modifications to the table rows and haven't been
vacuuming you're going to have all the dead rows in the table as well
as live ones.  On 7.2 you'd need a vacuum full to clear the space at this
point (you can use normal vacuum more frequently during normal operation
to avoid needing the full).

> does unvaccuming makes tables  x2000  times largers??