Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 62ABD9FBA48 for ; Mon, 21 May 2007 08:40:32 -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 16799-02 for ; Mon, 21 May 2007 08:40:27 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id D3FEF9FB9B7 for ; Mon, 21 May 2007 08:40:26 -0300 (ADT) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 59F6A76418; Mon, 21 May 2007 12:40:21 +0100 (BST) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 283D9274121; Mon, 21 May 2007 12:40:21 +0100 (BST) Message-ID: <46518525.9010407@archonet.com> Date: Mon, 21 May 2007 12:40:21 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: pgsql-performance@nullmx.com Cc: pgsql-performance@postgresql.org Subject: Re: Rewriting DISTINCT and losing performance References: <200705202228.32129.pgsql-performance@nullmx.com> In-Reply-To: <200705202228.32129.pgsql-performance@nullmx.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/390 X-Sequence-Number: 24780 Chuck D. wrote: > Table "geo.city" > Column | Type | Modifiers > ------------+------------------------+----------- > city_id | integer | not null > state_id | smallint | > country_id | smallint | > latitude | numeric(9,7) | > longitude | numeric(10,7) | > city_name | character varying(100) | > Indexes: > "city_pk" PRIMARY KEY, btree (city_id) > "idx_city_country_id" btree (country_id) CLUSTER > Foreign-key constraints: > "city_state_id_fk" FOREIGN KEY (state_id) REFERENCES geo.state(state_id) > ON UPDATE CASCADE ON DELETE CASCADE Any good reason why country_id is NULLable? -- Richard Huxton Archonet Ltd