Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UOV0z-0007HT-CC for pgsql-performance@arkaria.postgresql.org; Sat, 06 Apr 2013 15:26:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UOV0y-0003sb-DE for pgsql-performance@arkaria.postgresql.org; Sat, 06 Apr 2013 15:26:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UOV0x-0003sV-Au for pgsql-performance@postgresql.org; Sat, 06 Apr 2013 15:26:47 +0000 Received: from nm3-vm0.bullet.mail.bf1.yahoo.com ([98.139.212.154]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UOV0k-0001yM-CQ for pgsql-performance@postgresql.org; Sat, 06 Apr 2013 15:26:46 +0000 Received: from [98.139.215.143] by nm3.bullet.mail.bf1.yahoo.com with NNFMP; 06 Apr 2013 15:26:32 -0000 Received: from [98.139.212.240] by tm14.bullet.mail.bf1.yahoo.com with NNFMP; 06 Apr 2013 15:26:32 -0000 Received: from [127.0.0.1] by omp1049.mail.bf1.yahoo.com with NNFMP; 06 Apr 2013 15:26:32 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 16516.17016.bm@omp1049.mail.bf1.yahoo.com Received: (qmail 66365 invoked by uid 60001); 6 Apr 2013 15:26:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s1024; t=1365261991; bh=VTYRpQyyLM7Hg9U56UjyMJylhfTr4p602I/voaO4/8U=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=5ijsrdrKEUWtVKcj5DYaDI7jRqRZxhPntCVKckZIv8h7AD3izF2BjaUhqrx10lDkxn6bwGJ9wf6CRCUM3q5TBSBKQ4pb6CkChLSrEUJ3w1ri3fcctGMdnQo5r5J/YnrBCSVvTf37uOkeIVr6WFVd+bsA4kUHTJK7llvJELuwFT4= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=ymail.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=nTd4/55IQjAdeEjRAAZFcdWrIq83LoW+Bm/dG5yi32UneFPXpV+ErOn6dx8RLir95IG+eVC0vS/kV05u25p6nLoGYVEX+ZHOX30BA+mNFsEcwqJFiqwMAeLGjTL1ZjSoodT6723pCVNrlUlqWMCk46SRBn3fQuMsTmz0seUf8qQ=; X-YMail-OSG: O9.uIukVM1kceRSkEJ6QTTDA7VFQnipeBhWB4jGM5S8pndy 7LHdtshNtMvEOCOwXa2V5BJtdj6BI0YFyf2n8uX_jVNU1apWCwZMjxKyVDVJ pspxMDDPjZphMRFXjfHrmWnGiQnr.mf92gHntd.Z.kRcGNVRKDEHMaypcbuu gTlVvXq2pC3UQc6nNQ50052P0MUrzNDgYPRCRbYBGG3JyBVwZpZ6ei.J1lcm bbjHxLLazJtEc9aZw6BJfIq4jJG9C.T32D5z.RqgHRiFf4bamWzjHQmyFdrc 0vFxonLXZt4AINty1gZZA.hL5nK9c4BRNp0gFoC4OD0SGPsQ3tzFnj9CoyfX 46BxXCF72eHPBaWzvwf4cO4JnqWj6lbjel2gb9RTScnQPBaZQPmZM.GGzsAg TzFFFInHOSY2P9Ly.R1bqPU5ffG88pz0p9dDhZGtnd33qMRK.vp82O3EVewl HmtHEyyfRASVQ0aIWpp_.bVpkYkivUHPM1PsPXiBe0JUh7WZvk9VZ0EIwFwP xo7LSkKlXXGwz62ArSYYo7MLGa01w8pAp Received: from [76.255.18.237] by web162905.mail.bf1.yahoo.com via HTTP; Sat, 06 Apr 2013 08:26:31 PDT X-Rocket-MIMEInfo: 002.001, RnJhbmNrIFJvdXRpZXIgPGZyYW5jay5yb3V0aWVyQGF4ZWdlLmNvbT4gd3JvdGU6Cgo.IE9rLCB0aGUgcHJvYmxlbSBkZWZpbml0ZWx5IGNvbWVzIGZyb20gdGhlCj4gZGVmYXVsdF9zdGF0aXN0aWNzX3RhcmdldCB3aGljaCBpcyBvYnZpb3VzbHkgdG9vIGhpZ2ggb24gdGhlCj4gZGF0YWJhc2UuCgo.IE5vdy4uLiBjYW4gc29tZW9uZSBoZWxwIG1lIHVuZGVyc3RhbmQgd2hhdCBoYXBwZW5zID8gV2hlcmUgY2FuIEkKPiBsb29rIChpbiBwZ19zdGF0cyA_KSB0byBzZWUgdGhlIHNvdXJjZSBvZiB0aGUgcHJvYmwBMAEBAQE- X-Mailer: YahooMailWebService/0.8.140.532 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> Message-ID: <1365261991.56886.YahooMailNeo@web162905.mail.bf1.yahoo.com> Date: Sat, 6 Apr 2013 08:26:31 -0700 (PDT) From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: What happens between end of explain analyze and end of query execution ? To: Franck Routier , "pgsql-performance@postgresql.org" In-Reply-To: <515FE547.3010301@axege.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -2.0 (--) 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 wrote: > Ok, the problem definitely comes from the > default_statistics_target which is obviously too high on the > database. > Now... can someone help me understand what happens ? Where can I > look (in pg_stats ?) to see the source of the problem ? maybe a > column with a huge list of different values the palnner has to > parse ? This is a fundamental issue in query planning -- how much work do you want to do to try to come up with the best plan?=A0 Too little, and the plan can be unacceptably slow; too much and you spend more extra time on planning than the improvement in the plan (if any) saves you.=A0 Reading and processing statistics gets more expensive as you boost the volume. What I would suggest is taking the default_statistics_target for the cluster back down to the default, and selectviely boosting the statistics target for individual columns as you find plans which benefit.=A0 Don't set it right at the edge of the tipping point, but don't automatically jump to 5000 every time either. -- Kevin Grittner EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance