pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: greg@turnstep.com
To: pgsql-performance@postgresql.org
Subject: Re: Compare rows
Date: Fri, 10 Oct 2003 16:44:21 -0000
Message-ID: <1756cdfe0672f1cab443627e1fd7a4b3@biglumber.com> (raw)
In-Reply-To: <200310081611.59179.josh@agliodbs.com>


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> The most efficient way for you to store data would be like this:
> main table
> id  address
> 3   67.92
> 7   69.5
>
> child table
> id  value_type  value
> 3   uptime      0.3
> 3   memory      37
> 7   uptime      1.1
> 7   memory      15

Actually, a more efficient* way is this:

value table
vid value_name
1  uptime
2  memory

child table
id   vid   value
3     1     0.3
3     2     37
7     1     1.1
7     2     15


* Still not necessarily the *most* efficient, depending on how the 
values are distributed, but it sure beats storing "uptime" over 
and over again. :)


- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200310101243
-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE/huHxvJuQZxSWSsgRAiMNAKD4kQCwdv3fXyEFUu64mymtf567dwCcCKd5
ZzJaV7wjfs00DBT62bVpHhs=
=32b8
-----END PGP SIGNATURE-----





view thread (25+ messages)

Message-ID: <1756cdfe0672f1cab443627e1fd7a4b3@biglumber.com>
Permalink:  ../1756cdfe0672f1cab443627e1fd7a4b3@biglumber.com/
Also on:    postgresql.org/message-id/1756cdfe0672f1cab443627e1fd7a4b3@biglumber.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: greg@turnstep.com
  Subject: Re: Compare rows
  In-Reply-To: <1756cdfe0672f1cab443627e1fd7a4b3@biglumber.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox