Re: PostgreSQL db, 30 tables with number of rows < 100 (not huge) - the fastest way to clean each non-empty table and reset unique identifier column of empty ones. - Mailing list pgsql-performance

From Stanislaw Pankevich
Subject Re: PostgreSQL db, 30 tables with number of rows < 100 (not huge) - the fastest way to clean each non-empty table and reset unique identifier column of empty ones.
Date
Msg-id CAFXpGYaJTEhVTiLYS5iPpPN9TUH35uJYxG4G53gky3LdjShDCg@mail.gmail.com
Whole thread Raw
In response to Re: PostgreSQL db, 30 tables with number of rows < 100 (not huge) - the fastest way to clean each non-empty table and reset unique identifier column of empty ones.  ("Marc Mamin" <M.Mamin@intershop.de>)
List pgsql-performance
Marc, thanks for the answer.

Na, these seem not to be enough universal and easy to hook into
existing truncation strategies used in Ruby world.

On Fri, Jul 6, 2012 at 6:24 PM, Marc Mamin <M.Mamin@intershop.de> wrote:
>
>
>
> Stanislaw Pankevich wrote:
>>>> ==== PostgreSQL db, 30 tables with number of rows < 100 (not huge) - the
>>>> fastest way to clean each
>>>> non-empty table and reset unique identifier column of empty ones ====
>
> Hello,
>
> 2 'exotic' ideas:
>
> - use dblink_send_query to do the job in multiple threads (I doubt this
> really could be faster)
> - have prepared empty tables in a separate schema, and a "garbage schema":
>
>    ALTER TABLE x set schema garbage;
>    ALTER TABLE prepared.x set schema "current";
>
> you should be ready for the next test,
>
> but still have to clean garbage nad moved to prepared for the next but one
> in the background....
>
> best regards,
>
> Marc Mamin

pgsql-performance by date:

Previous
From: Yan Chunlu
Date:
Subject: Re: how could select id=xx so slow?
Next
From: Shaun Thomas
Date:
Subject: Re: Paged Query