Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8A15H765847 for ; Sun, 9 Sep 2001 21:05:17 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 116070; Sun, 09 Sep 2001 18:05:12 -0700 From: "Josh Berkus" Subject: Re: optimizing queries and indexes... To: Stephan Szabo , "Robert J. Sanford, Jr." , Josh Berkus Cc: pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Sun, 09 Sep 2001 18:05:12 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="_===116070====davinci.ethosmedia.com===_" X-Archive-Number: 200109/32 X-Sequence-Number: 4678 This is a multi-part MIME message --_===116070====davinci.ethosmedia.com===_ Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit 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 --_===116070====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===116070====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===116070====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===116070====davinci.ethosmedia.com===_--