Re: Yet another "drop table vs delete" question

From: asceta <marek(dot)patrzek(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Yet another "drop table vs delete" question
Date: 2009-04-21 20:09:38
Message-ID: 35815f6d-a679-44e0-b4d1-c9c9a793604e@g1g2000yqh.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 21 Kwi, 21:30, alvhe(dot)(dot)(dot)(at)commandprompt(dot)com (Alvaro Herrera) wrote:
> marek(dot)patr(dot)(dot)(dot)(at)gmail(dot)com escribió:
>
> > I was wondering if dropping a table is more efficient in PostgreSQL
> > 8.x in comparison to deleting it's content ?
>
> "8.x" is a meaningless version number in Postgres.  Major versions (with
> new features, etc) are labeled by the first two elements, so 8.0, 8.1,
> and so on.
>
> To actually answer your question,
>
> > The thing is, postgresql may leave some invalid content behind in both
> > situations. The real question is - which of those two options leaves
> > less garbage to be vaccumed ? At this point I don't relay care about
> > cost based efficiency but cutting down pg background work.
>
> Try TRUNCATE.  That leaves the less garbage behind and takes the less
> time.
>
> --
> Alvaro Herrera                                http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.
>
> --
> Sent via pgsql-general mailing list (pgsql-gene(dot)(dot)(dot)(at)postgresql(dot)org)
> To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general

Thank you for all your help.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Browne 2009-04-21 20:13:39 Re: Yet another "drop table vs delete" question
Previous Message David Fetter 2009-04-21 20:09:08 Re: [GENERAL] PostgreSQL versus MySQL for GPS Data