pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Poul L. Christiansen <plc@faroenet.fo>
To: Joerg Hessdoerfer <Joerg.Hessdoerfer@sea-gmbh.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Continuous inserts...
Date: Thu, 17 Aug 2000 15:50:00 +0100
Message-ID: <399BFB98.67D58A7D@faroenet.fo> (raw)
References: <4.3.2.7.0.20000817162006.00af3db0@192.168.0.1>

Isn't easier to reduce the table every day and make a daily vacuum which only
lasts a few seconds?

Joerg Hessdoerfer wrote:

> Hi!
>
> I have an application, where I have to insert data into a table at several
> rows per second, 24 hours a day, 365 days a year.
>
> After some period (a week, maybe a month) the data will be reducted to some
> degree and deleted from the table.
>
> As far as I understood, I would have to use VACUUM to really free the table
> from deleted rows - but VACUUM (esp. on a table with several million rows)
> takes some time and prevents me from inserting new data.
>
> Now, I thought I could just rename the table, inserting into a temp table, and
> switch the tables back after VACUUMing. Ideally, this should work unnoticed
> (and thus without prog. effort) on the client (inserter) side.
>
> Question: would it work to use a transaction to perform the rename?
>
> i.e.: continuous insert into table 'main' from client.
>
>  From somewhere else, execute:
>
> begin;
> alter table main rename to vac_main;
> create table main (...);
> end;
>
> would the inserter notice this? Read: would ALL inserts AT ANY TIME succeed?
>
> I know, I could simulate such functionality in the client (inserter). But it
> seems more elegant this way...
>
> Greetings,
>         Joerg
> +------****  Science & Engineering Applications GmbH  ****------+
> |                                                               |
> | Joerg Hessdoerfer                                             |
> | Leading SW developer Phone:    +49 (0)2203-962211             |
> | S.E.A GmbH           Fax:                 -962212             |
> | D-51147 Koeln        Internet: joerg.hessdoerfer@sea-gmbh.com |
> |                                http://www.sea-gmbh.com        |
> +---------------------------------------------------------------+




view thread (15+ messages)  latest in thread

Message-ID: <399BFB98.67D58A7D@faroenet.fo>
Permalink:  ../399BFB98.67D58A7D@faroenet.fo/
Also on:    postgresql.org/message-id/399BFB98.67D58A7D@faroenet.fo

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: plc@faroenet.fo, Joerg.Hessdoerfer@sea-gmbh.com
  Subject: Re: Continuous inserts...
  In-Reply-To: <399BFB98.67D58A7D@faroenet.fo>
  References: <4.3.2.7.0.20000817162006.00af3db0@192.168.0.1> <399BFB98.67D58A7D@faroenet.fo>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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