Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UOVxu-0001pO-3B for pgsql-performance@arkaria.postgresql.org; Sat, 06 Apr 2013 16:27:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UOVxt-0008FA-B9 for pgsql-performance@arkaria.postgresql.org; Sat, 06 Apr 2013 16:27:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UOVxs-0008F4-CH for pgsql-performance@postgresql.org; Sat, 06 Apr 2013 16:27:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UOVxc-0003J0-PL for pgsql-performance@postgresql.org; Sat, 06 Apr 2013 16:27:40 +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 r36GRL82005542; Sat, 6 Apr 2013 12:27:21 -0400 (EDT) From: Tom Lane To: Franck Routier cc: pgsql-performance@postgresql.org Subject: Re: What happens between end of explain analyze and end of query execution ? In-reply-to: <515FE547.3010301@axege.com> 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> Comments: In-reply-to Franck Routier message dated "Sat, 06 Apr 2013 11:05:11 +0200" Date: Sat, 06 Apr 2013 12:27:21 -0400 Message-ID: <5541.1365265641@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 Franck Routier writes: > Le 05/04/2013 16:17, Tom Lane a écrit : >> What have you got the statistics targets set to in this database? > Ok, the problem definitely comes from the default_statistics_target > which is obviously too high on the database. 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. The actual cost would depend a lot on the specific column datatypes. Not sure about your report that re-analyzing with the same stats target made a significant difference. It might have been a matter of chance variation in the sampled MCV list leading to more or fewer matches. 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