Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 71CE29FB2F1 for ; Mon, 21 May 2007 14:13:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 00835-01 for ; Mon, 21 May 2007 14:13:43 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from k2smtpout02-02.prod.mesa1.secureserver.net (k2smtpout02-02.prod.mesa1.secureserver.net [64.202.189.91]) by postgresql.org (Postfix) with SMTP id C01129FB283 for ; Mon, 21 May 2007 14:13:42 -0300 (ADT) Received: (qmail 27933 invoked from network); 21 May 2007 17:13:41 -0000 Received: from unknown (HELO mail.servantwebhosting.com) (68.178.159.82) by k2smtpout02-02.prod.mesa1.secureserver.net (64.202.189.91) with ESMTP; 21 May 2007 17:13:41 -0000 Received: (qmail 25985 invoked by uid 2527); 21 May 2007 10:13:41 -0700 Received: from 70.64.210.50 by jonah.prod.phx1.secureserver.net (envelope-from , uid 2525) with qmail-scanner-1.25-st-qms (clamdscan: 0.86.2/989. spamassassin: 3.1.8. perlscan: 1.25-st-qms. Clear:RC:0(70.64.210.50):SA:0(1.4/5.0):. Processed in 2.367252 secs); 21 May 2007 17:13:41 -0000 X-Antivirus-MYDOMAIN-Mail-From: pgsql-performance@nullmx.com via jonah.prod.phx1.secureserver.net X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:0(70.64.210.50):SA:0(1.4/5.0):. Processed in 2.367252 secs Process 25847) X-Envelope-From: pgsql-performance@nullmx.com Received: from s010600e0296eec95.mj.shawcable.net (HELO shach) (rob@nullmx.com@70.64.210.50) by mail.servantwebhosting.com with SMTP; 21 May 2007 10:13:38 -0700 From: "Chuck D." Reply-To: pgsql-performance@nullmx.com To: pgsql-performance@postgresql.org Subject: Re: Rewriting DISTINCT and losing performance Date: Mon, 21 May 2007 11:13:23 -0600 User-Agent: KMail/1.9.5 References: <200705202228.32129.pgsql-performance@nullmx.com> <46518525.9010407@archonet.com> In-Reply-To: <46518525.9010407@archonet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200705211113.24689.pgsql-performance@nullmx.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.032 tagged_above=0 required=5 tests=AWL=-0.104, BAYES_50=0.001, FORGED_RCVD_HELO=0.135 X-Spam-Level: X-Archive-Number: 200705/393 X-Sequence-Number: 24783 On Monday 21 May 2007 05:40, Richard Huxton wrote: > Chuck D. wrote: > > Any good reason why country_id is NULLable? It has been a while since I imported the data so it took some time to examine it but here is what I found. In the original data, some cities do not have coutries. Strange huh? Most were in the Gaza Strip, No Man's Land or disputed territory where several countries claimed ownership. This is according to USGS and the board of names. Recognizing that this did me no good in my application I decided to repair that data so that country_id could have a NOT NULL modifier.