| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
|---|---|
| To: | Steve Wampler <swampler(at)noao(dot)edu> | 
| Cc: | postgres-general <pgsql-general(at)postgresql(dot)org> | 
| Subject: | Re: Speed of locating tables? | 
| Date: | 2000-05-26 16:34:17 | 
| Message-ID: | 2447.959358857@sss.pgh.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
Steve Wampler <swampler(at)noao(dot)edu> writes:
> Hmmm, but there's now only one table (with around 2 million rows)
> instead of 100,000 (each with around 20 rows) right?  (I'm confused by
> the "Every table gets...").  I read what you've written as saying "add
> the configuration set ID to each attribute (so now it's an ID, name,
> value triple instead of a pair), storing all attributes for all sets
> in a single table 
Right so far.
> and then, when given an ID, search the table,
> collect the matching rows into a temporary table and reference the
> attributes from that temporary table" - is that correct?  [I don't
> need fast update of the attributes, just fast read access while the
> sun is shining.]
There's no particular reason to make a temp table.  As long as you have
an index on the ID column, queries like
SELECT * FROM configurations WHERE id = 'foo';
will be fast. This is what DBMSes live to do.
> I imagine I can pull "old" configuration sets from the large table
> (every night, perhaps) and archive them into some other table(s) to
> keep the size of the active table smaller.
If you insist, but it's unlikely to be worth the trouble.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Barry Lind | 2000-05-26 16:47:17 | Re: Speed of locating tables? | 
| Previous Message | Bryan White | 2000-05-26 16:16:13 | Re: PG 7.0 is 2.5 times slower running a big report |