Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UPFDH-0007eD-3z for pgsql-performance@arkaria.postgresql.org; Mon, 08 Apr 2013 16:46:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UPFDG-0007gV-Go for pgsql-performance@arkaria.postgresql.org; Mon, 08 Apr 2013 16:46:34 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UPFDF-0007gQ-Oa for pgsql-performance@postgresql.org; Mon, 08 Apr 2013 16:46:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UPFDD-000542-AD for pgsql-performance@postgresql.org; Mon, 08 Apr 2013 16:46:33 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r38GkRxc016276; Mon, 8 Apr 2013 12:46:27 -0400 (EDT) From: Tom Lane To: Jeff Janes cc: Franck Routier , "pgsql-performance@postgresql.org" Subject: Re: What happens between end of explain analyze and end of query execution ? In-reply-to: References: <515D92BF.5000309@axege.com> <515D9FC5.7030105@axege.com> <18910.1365092713@sss.pgh.pa.us> <515DCB34.6040801@axege.com> <6354.1365102532@sss.pgh.pa.us> <515ED7BC.40907@axege.com> <4113.1365171448@sss.pgh.pa.us> <515FE547.3010301@axege.com> <5541.1365265641@sss.pgh.pa.us> Comments: In-reply-to Jeff Janes message dated "Mon, 08 Apr 2013 09:39:01 -0700" Date: Mon, 08 Apr 2013 12:46:26 -0400 Message-ID: <16275.1365439586@sss.pgh.pa.us> X-Pg-Spam-Score: -4.3 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Jeff Janes writes: > On Sat, Apr 6, 2013 at 9:27 AM, Tom Lane wrote: >> Yeah, eqjoinsel() is O(N^2) in the lengths of the MCV lists, in the >> worst case where there's little overlap in the list memberships. > I guess this pre-emptively answers a question I was intending to ask on > performance: Whether anyone increased default_statistics_target and came > to regret it. I had seen several problems fixed by increasing > default_statistics_target, but this is the first one I recall caused by > increasing it. I recall having heard some similar complaints before, but not often. > Do you think fixing the O(N^2) behavior would be a good to-do item? If you can think of a way to do it that doesn't create new assumptions that eqjoinsel ought not make (say, that the datatype is sortable). I guess one possibility is to have a different join selectivity function for those types that *are* sortable, which would fix the issue for most commonly used types. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance