[SQL] deleting records from a table
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
Re: [SQL] deleting records from a table
---> 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. ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [SQL] deleting records from a table
> 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. ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [SQL] deleting records from a table
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. ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate
Re: [SQL] deleting records from a table
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 | [EMAIL PROTECTED] "The year's penultimate month" is not in truth a good way of saying November. --H.W. Fowler ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate
