X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F3D66DB49E for ; Sat, 12 Nov 2005 05:14:48 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 01048-10 for ; Sat, 12 Nov 2005 09:14:46 +0000 (GMT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.200]) by svr1.postgresql.org (Postfix) with ESMTP id 182B3DB49B for ; Sat, 12 Nov 2005 05:14:46 -0400 (AST) Received: by wproxy.gmail.com with SMTP id 57so706214wri for ; Sat, 12 Nov 2005 01:14:49 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=AbIJJQoCaTN9OwP99n3Eem5kNWrUaQOi6yq2DeL1PsYqYsEL5Wh7Z275638RkdZtnGnzj+2ulQZDeSySjsb6jSstCDpEwg65W+qm5JmNy9Sg0Vad7LneoJs8tqzhogRgB4ByNRKtIE+dNL2u2ZaDf0Sh9bIyYT+0j/2mgWHO72Y= Received: by 10.54.76.9 with SMTP id y9mr1788797wra; Sat, 12 Nov 2005 01:14:49 -0800 (PST) Received: by 10.54.117.8 with HTTP; Sat, 12 Nov 2005 01:14:49 -0800 (PST) Message-ID: <9e4684ce0511120114m32254efen2faa6563146db202@mail.gmail.com> Date: Sat, 12 Nov 2005 10:14:49 +0100 From: hubert depesz lubaczewski To: dwinner-lists@att.net Subject: Re: slow queries after ANALYZE Cc: pgsql-performance@postgresql.org In-Reply-To: <4374EDF1.5010709@att.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2159_29838048.1131786889103" References: <4374EDF1.5010709@att.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.052 required=5 tests=[AWL=0.051, HTML_MESSAGE=0.001] X-Spam-Score: 0.052 X-Spam-Level: X-Archive-Number: 200511/220 X-Sequence-Number: 15477 ------=_Part_2159_29838048.1131786889103 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 11/11/05, DW wrote: > > I'm perplexed. I'm trying to find out why some queries are taking a long > time, and have found that after running analyze, one particular query > becomes slow. > i have had exactly the same problem very recently. what helped? increasing statistics on come column. which ones? make: explain analyze ; and check in which situations you gget the biggest change of "estiamted rows" and "actual rows". then check what this particular part of your statement is touching, and increase appropriate statistics. depesz ------=_Part_2159_29838048.1131786889103 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 11/11/05, DW <dwinner-lists@att.net> wrote:
I'm perplexed. I'm trying to find out why some queries are taking a longtime, and have found that after running analyze,  one particular= query
becomes slow.

i have had exactly the same problem very recently.
what helped? increasing statistics on come column.
which ones?
make:
explain analyze <your select>;
and check in which situations you gget the biggest change of "estiamte= d rows" and "actual rows".
then check what this particular part of your statement is touching, and inc= rease appropriate statistics.

depesz
------=_Part_2159_29838048.1131786889103--