Re: History Tables Vs History Field - Mailing list pgsql-admin

From Erwin Brandstetter
Subject Re: History Tables Vs History Field
Date
Msg-id Xns94A843FBDDF92Xaraweda@195.34.132.16
Whole thread Raw
In response to History Tables Vs History Field  (Bart McFarling <pbm1@midsouth.rr.com>)
List pgsql-admin
Bart McFarling wrote:

> I have a table that will recieve about 2000 inserts per day,
> Although it will technically never be dead data, about 99.999% of
> it will be uninteresing after 30-40 days,  My problem is that I
> dont know if I should create a new table that is a history table
> or add a indexed field and ignore the data in queries unless
> someone asks for it. The latter is my prefered way of dealing with
> it, Is there something Im missing? Is there another way to do
> this? Any Suggestions are appreciated.

I guess if 99% of your queries would only ever use the "interesting"
data, you should go for the "history" version, which would speed your
those queries a lot. As you have distinct id's on both tables (having
fetched from the same sequence initially), u can always do a union
select on both tables in the rare cases this is needed.

HTH, just my 2c
Erwin Brandstetter

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Restricting Groups / Users
Next
From: Erwin Brandstetter
Date:
Subject: Hardware for a database server