pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feeddeleting records from a table
5+ messages / 4 participants
[nested] [flat]
* deleting records from a table
@ 2007-01-12 17:45 Mario Behring <mariobehring@yahoo.com>
0 siblings, 3 replies; 5+ messages in thread
From: Mario Behring @ 2007-01-12 17:45 UTC (permalink / raw)
To: pgsql-sql
Hi all,
Simple question: once I execute the delete statement, does it free disk space immediatelly? Does Postgres uses something like a datafile with a pre-defined size like Oracle does??
Please advise.
Thank you.
Mario
____________________________________________________________________________________
Get your own web address.
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: deleting records from a table
@ 2007-01-12 17:53 Richard Broersma Jr <rabroersma@yahoo.com>
parent: Mario Behring <mariobehring@yahoo.com>
2 siblings, 0 replies; 5+ messages in thread
From: Richard Broersma Jr @ 2007-01-12 17:53 UTC (permalink / raw)
To: Mario Behring <mariobehring@yahoo.com>; pgsql-sql
---> Simple question: once I execute the delete statement, does it free disk space immediatelly?
No. deleted rows (in a sense) are simply marked as deleted and are made avaliable for being
written over by a new or updated tuple. If you want to recover the space you can you TRUNCATE or
VACUUM FULL & possible REINDEX.
Regards,
Richard Broersma Jr.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: deleting records from a table
@ 2007-01-12 18:30 Richard Broersma Jr <rabroersma@yahoo.com>
0 siblings, 0 replies; 5+ messages in thread
From: Richard Broersma Jr @ 2007-01-12 18:30 UTC (permalink / raw)
To: Mario Behring <mariobehring@yahoo.com>; +Cc: pgsql-sql
> Thank you for your help.
>
> I am already running the vacuumdb full.............after it finishes (I guess it will take a
> while to finish...) how should I execute this REINDEX ? Is there a single command to reindex the
> entire database?
Here is a link that describes its use:
http://www.postgresql.org/docs/8.2/interactive/app-reindexdb.html
Regards,
Richard Broersma Jr.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: deleting records from a table
@ 2007-01-12 18:48 Scott Marlowe <smarlowe@g2switchworks.com>
parent: Mario Behring <mariobehring@yahoo.com>
2 siblings, 0 replies; 5+ messages in thread
From: Scott Marlowe @ 2007-01-12 18:48 UTC (permalink / raw)
To: Mario Behring <mariobehring@yahoo.com>; +Cc: pgsql-sql
On Fri, 2007-01-12 at 11:45, Mario Behring wrote:
> Hi all,
>
> Simple question: once I execute the delete statement, does it free
> disk space immediatelly? Does Postgres uses something like a datafile
> with a pre-defined size like Oracle does??
>
Take a look here:
http://www.postgresql.org/docs/8.2/static/routine-vacuuming.html
http://www.postgresql.org/docs/8.2/static/mvcc-intro.html
That should explain the basics of mvcc and vacuuming as applies to
pgsql.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: deleting records from a table
@ 2007-01-12 20:51 Andrew Sullivan <ajs@crankycanuck.ca>
parent: Mario Behring <mariobehring@yahoo.com>
2 siblings, 0 replies; 5+ messages in thread
From: Andrew Sullivan @ 2007-01-12 20:51 UTC (permalink / raw)
To: pgsql-sql
On Fri, Jan 12, 2007 at 09:45:28AM -0800, Mario Behring wrote:
> Simple question: once I execute the delete statement, does it free
> disk space immediatelly? Does Postgres uses something like a
> datafile with a pre-defined size like Oracle does??
What others said; but note that a vacuumed table that has a number of
now-empty slots can actually be a performance advantage, because new
rows don't need to increase the size of the table's on-disk file (so
you incur slightly less I/O). There's a "sweet spot" for this that
you can discover by testing.
A
--
Andrew Sullivan | ajs@crankycanuck.ca
"The year's penultimate month" is not in truth a good way of saying
November.
--H.W. Fowler
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2007-01-12 20:51 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-01-12 17:45 deleting records from a table Mario Behring <mariobehring@yahoo.com>
2007-01-12 17:53 ` Richard Broersma Jr <rabroersma@yahoo.com>
2007-01-12 18:48 ` Scott Marlowe <smarlowe@g2switchworks.com>
2007-01-12 20:51 ` Andrew Sullivan <ajs@crankycanuck.ca>
2007-01-12 18:30 Re: deleting records from a table Richard Broersma Jr <rabroersma@yahoo.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox