Re: Help normalizing table(s)

From: "Shridhar Daithankar" <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Help normalizing table(s)
Date: 2002-10-17 15:54:59
Message-ID: 3DAF2AAB.19669.1CED932@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 17 Oct 2002 at 11:12, Kevin Old wrote:

> My solution to this is to store the data in tables by hour. This keeps
> the tables relatively small (50-100K records) and helps with searching.
>
> Now on to the real questions:
>
> I need to be able to search more than one table at a time, but just
> "union"ing the queries isn't a very good option as some users want to
> search 48 hours worth of data.....that would result in 48 unioned
> queries!!!!
> How do I keep this table rather small (1 million records or so) and
> still be able to search archived data? Are there any other ways that I
> can do this?

Why do I feel that you are using my design? Probably because you are solving
same problem as I am solving..:-)

In postgresql, you can inherit a table from another table. You can query on
base table and gather rows from child table. So make an empty base table, make
each hourly table child of base table and query on base table. It will take
care of everything. Remove the hourly table after 48 hours..

Bye
Shridhar

--
Killing is wrong. -- Losira, "That Which Survives", stardate unknown

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shane Wright 2002-10-17 15:59:48 Re: PostgreSQL query failed: COPY state must be terminated first
Previous Message Robert Treat 2002-10-17 15:42:11 Re: Help changing varchar field