Re: Table design - postgresql solution - Mailing list pgsql-general

From Michał Roszka
Subject Re: Table design - postgresql solution
Date
Msg-id 20101204194620.d7219a3f.mike@if-then-else.pl
Whole thread Raw
In response to Table design - postgresql solution  (Miguel Vaz <pagongski@gmail.com>)
List pgsql-general
Sat, 4 Dec 2010 13:24:27 +0000
Miguel Vaz <pagongski@gmail.com>

> Your solution seems great and does the trick, but if most (and having
> some items that relate to all 3 tables) of my relations are between
> two tables, close to 1/3 of the id_tx fields would be null, correct?
> I may be wrong in thinking like this, but always had this thing of
> keeping tables very tight regarding null entries. Am i thinking
> wrong? Or maybe worrying too much on less important things. :-)

Well, test it.  EXPLAIN is a cool thing.

http://www.postgresql.org/docs/9.0/static/sql-explain.html
http://explain.depesz.com/
http://explain.depesz.com/help/

You can do some optimisation and significantly improve performance
of particular SELECT queries by creating proper indexes.  I would not be
too worried about the NULLs.  I do not know, how much data and how large
database we are talking about.  Maybe you should consult someone more
experienced.  I only work with small databases: 2 GB of data, less than
a million rows per table.

Oh, and I am CC'ing the mailing list. ;)

Cheers!

--
Michał Roszka
mike@if-then-else.pl

pgsql-general by date:

Previous
From: Cédric Villemain
Date:
Subject: Re: Looking for auto starting procedures
Next
From: "James B. Byrne"
Date:
Subject: Re: PG84 and SELinux