From: Aasmund Midttun Godal <postgresql@envisity.com>
To: archie@netg.se
Cc: pgsql-sql@postgresql.org
Subject: Re: NULL values or not?
Date: Fri, 21 Dec 2001 15:24:55 GMT
Message-ID: <20011221152455.4672.qmail@213-145-170-138.dd.nextgentel.com> (raw)
In-Reply-To: <Pine.LNX.4.21.0112211549310.21359-100000@valdez.netg.se>
References: <Pine.LNX.4.21.0112211549310.21359-100000@valdez.netg.se>
What is the problem with nulls? why are they bad??
Regards,
Aasmund.
On Fri, 21 Dec 2001 16:08:07 +0100 (CET), Archibald Zimonyi <archie@netg.se> wrote:
>
> Hi all,
>
> thanks for the replies. Most of you didn't read my post correctly though,
> I know that on our earth we have people with more then one FirstName, and
> some with no LastName etc. I stated however that if we had a world where
> people had only 1 FirstName and 1 LastName but it was not necessary to
> have a PhoneNumber would my first of my second structure be advisable to
> create?
>
> The schema too scattered. That is exactly the way I like to build my
> tables, the question was is it advisable? I can still get my (although
> fairly low amount of data) statements to work, takes about 1 second to
> start the search from the webbpage until the document is done again. That
> is fairly fast and well below the time limit that people tend to find
> annoying when searching for something.
>
> So in effect my databasestructure works nicely, no NULLS and lots of
> tables.
>
> Again, I will include my schema and functions as attachments.
>
> The question I asked, and will ask again, why should I add a column with
> NULL values rather then having a new table with that info instead? When
> will the NULL value be worth it. I take it there is less cost of simply
> having one table scan then joining two tables with a left join in order
> to retrive all rows.
>
> What if the PhoneNumber is an ID to another table that would look like
> this:
>
> CREATE TABLE phonenumber
> (
> phonenumber_id int2,
> phonenumber
> );
>
> with all keys etc.
>
> If I have to retrieve FirstName, LastName and PhoneNumber I would still
> have to join the two tables with a left join, since phonenumber_id has to
> match in both tables.
>
> Archie
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
Aasmund Midttun Godal
aasmund@godal.com - http://www.godal.com/
+47 40 45 20 46
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-sql@postgresql.org
Cc: postgresql@envisity.com, archie@netg.se
Subject: Re: NULL values or not?
In-Reply-To: <20011221152455.4672.qmail@213-145-170-138.dd.nextgentel.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