Re: Help normalizing table(s) - Mailing list pgsql-general

From Shridhar Daithankar
Subject Re: Help normalizing table(s)
Date
Msg-id 3DAF2AAB.19669.1CED932@localhost
Whole thread Raw
In response to Help normalizing table(s)  (Kevin Old <kold@carolina.rr.com>)
Responses Re: Help normalizing table(s)  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
List 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


pgsql-general by date:

Previous
From: Robert Treat
Date:
Subject: Re: Help changing varchar field
Next
From: Shane Wright
Date:
Subject: Re: PostgreSQL query failed: COPY state must be terminated first