Unix Technical Forum

Database size

This is a discussion on Database size within the Pgsql Performance forums, part of the PostgreSQL category; --> Hi all, I had a database which uses to hold some 50 Mill records and disk space used was ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 10:57 AM
choksi
 
Posts: n/a
Default Database size

Hi all,

I had a database which uses to hold some 50 Mill records and disk
space used was 103 GB. I deleted around 34 Mill records but still the
disk size is same. Can some on please shed some light on this.

Thank in advance for all the help.

Dhawal Choksi

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 11:00 AM
A. Kretschmer
 
Posts: n/a
Default Re: Database size

am Fri, dem 08.06.2007, um 1:22:14 -0700 mailte choksi folgendes:
> Hi all,
>
> I had a database which uses to hold some 50 Mill records and disk
> space used was 103 GB. I deleted around 34 Mill records but still the
> disk size is same. Can some on please shed some light on this.


DELETE only mark rows as deleted, if you need the space you need a
VACUUM FULL.

Read more: http://www.postgresql.org/docs/curre...ql-vacuum.html


Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 11:00 AM
Francisco Reyes
 
Posts: n/a
Default Re: Database size

choksi writes:

> I had a database which uses to hold some 50 Mill records and disk
> space used was 103 GB. I deleted around 34 Mill records but still the
> disk size is same. Can some on please shed some light on this.


When records are deleted they are only marked in the database.
When you run vacuum in the database that space will be marked so new data
can use the space.

To lower the space used you need to run "vacuum full".
That however can take a while and I think it will lock the database for
some operations.

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 11:01 AM
J6M
 
Posts: n/a
Default Re: Database size

Hello group,

Moreover a reindex (REINDEX <name of your database> while in pgsql) followed
by an ANALYZE will claim more space.

Regards
J6M
----- Original Message -----
From: "Francisco Reyes" <lists@stringsutils.com>
To: "choksi" <choksi.dhaval@gmail.com>
Cc: <pgsql-performance@postgresql.org>
Sent: Friday, June 15, 2007 7:15 PM
Subject: Re: [PERFORM] Database size


> choksi writes:
>
>> I had a database which uses to hold some 50 Mill records and disk
>> space used was 103 GB. I deleted around 34 Mill records but still the
>> disk size is same. Can some on please shed some light on this.

>
> When records are deleted they are only marked in the database.
> When you run vacuum in the database that space will be marked so new data
> can use the space.
>
> To lower the space used you need to run "vacuum full".
> That however can take a while and I think it will lock the database for
> some operations.



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:04 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com