From: Josh Berkus <josh@agliodbs.com>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Robert J. Sanford, Jr. <rsanford@nolimitsystems.com>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: optimizing queries and indexes...
Date: Sun, 09 Sep 2001 18:05:12 -0700
Message-ID: <web-116070@davinci.ethosmedia.com> (raw)
In-Reply-To: <Pine.BSF.4.21.0109091646370.11941-100000@megazone23.bigpanda.com>
Stephan,
Ah. Well, you answer optimization questions so often that I'd assumed
that you had a hand in it. Is the optimizer all Tom and Bruce's work?
> At least on 7.1 and below, if you have a dummy value that is very
> common
> but doesn't really pass any information (like 'N/A' for example),
> consider
> using NULL instead. The optimizer statistics can often be thrown
> off-kilter by values that are much more common than the real data.
Personally, I cannot reccomend this. There are a number of
normalization problems with using NULL instead of 'N/A' or 0 or another
"no" value. Some database theorists (Fabian Pascal & co.) even propose
the elimination of NULL from the SQL spec on the grounds that it
encourages bad DB design. As such, I have a hard time reccommending any
course that involves adding *more* NULLs to the database, especially for
a marginal query performance gain.
To phrase it another way: Optimization problems cost you seconds. DB
Design and normalization problems cost you *days*.
-Josh Berkus
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh@agliodbs.com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
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: josh@agliodbs.com, sszabo@megazone23.bigpanda.com, rsanford@nolimitsystems.com
Subject: Re: optimizing queries and indexes...
In-Reply-To: <web-116070@davinci.ethosmedia.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