Re: Query questions

From: Ragnar Hafstað <gnari(at)simnet(dot)is>
To: flyvholm(at)gfy(dot)ku(dot)dk
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Query questions
Date: 2005-09-03 09:47:23
Message-ID: 1125740844.9839.9.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 2005-09-03 at 00:59 -0800, Poul Jensen wrote:
> I'm building a database containing key parameters for ~500,000 data
> files. The design I found logical is
>
> Two tables for each file:
> 1) Larger table with detailed key parameters
> (10-15 columns, ~1000 rows), call it large_table
> 2) Small table with file summary
> (~30 columns, 1 row), call it small_table

you want to create 1 million tables, all with one of
2 schemas?

why not just 2 tables, each with the additional "file"
column ?

> ...
> SELECT <large_table columns> FROM <regular expression>
> WHERE <condition on large_table>
> IF <condition on corresponding small_table>;

this would then be something like:

SELECT <large_table columns> FROM large_table
WHERE file ~ <regular expression>
AND <condition on large_table>
AND <subquery involving small_table>

gnari

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dick Kniep 2005-09-03 14:07:34 Re: Schema problems RedHat / SuSE 9.3 for version 7.4.8
Previous Message Poul Jensen 2005-09-03 08:59:54 Query questions