X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 1572E9DCBF3 for ; Tue, 6 Dec 2005 17:08:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 91212-09 for ; Tue, 6 Dec 2005 17:08:35 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id 15D9D9DCBE7 for ; Tue, 6 Dec 2005 17:08:31 -0400 (AST) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 2BF963093D; Tue, 6 Dec 2005 22:08:33 +0100 (MET) From: Ron Mayer X-Newsgroups: pgsql.performance Subject: Re: Missed index opportunity for outer join? Date: Tue, 06 Dec 2005 13:15:13 -0800 Organization: Hub.Org Networking Services Lines: 18 Message-ID: <4395FF61.6060301@cheapcomplexdevices.com> References: <3267.1133822299@sss.pgh.pa.us> <4678.1133888239@sss.pgh.pa.us> <4395F1F3.1000803@cheapcomplexdevices.com> <15962.1133901211@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org To: Tom Lane User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en In-Reply-To: <15962.1133901211@sss.pgh.pa.us> To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/194 X-Sequence-Number: 16015 Tom Lane wrote: > ...planner is actually going to choose based on the ultimate join cost, > not on the subplan costs... > > In this explanation, the reason for the change in plans over time could > be a change in the statistics for the other table. Is "facets" more > dynamic than "point_features"? In total rows changing it's more dynamic, but percentage-wise, it's less dynamic (point_features probably turns round 50% of it's rows in a day -- while facets turns over about 3% per day -- but facets is 1000X larger). Facets is a big table with rather odd distributions of values. Many of the values in the indexed columns show up only once, others show up hundreds-of-thousands of times. Perhaps an analyze ran and just randomly sampled differently creating different stats on that table?