X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EF2B552838 for ; Thu, 26 May 2005 18:23:17 -0300 (ADT) 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 56959-07 for ; Thu, 26 May 2005 21:23:14 +0000 (GMT) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.196]) by svr1.postgresql.org (Postfix) with ESMTP id CE0F352851 for ; Thu, 26 May 2005 18:23:13 -0300 (ADT) Received: by zproxy.gmail.com with SMTP id 12so81374nzp for ; Thu, 26 May 2005 14:23:15 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=TFucyox5OfhRleb/G16U2oPWBVD0ooLC71E9xIQ4TLQbR/+CX4xqR19V+vYASD8L7b8UqL1pzr4/OaennEYUQV+qf/phlgQtwT2aGfQUZHX6MfhVaB5tBhj5FcJVR4mn9D1hc9GLYyPI88sKkFXx13ighrUSQeC1gUQZ32fGXfA= Received: by 10.36.68.2 with SMTP id q2mr844397nza; Thu, 26 May 2005 14:23:15 -0700 (PDT) Received: by 10.36.22.20 with HTTP; Thu, 26 May 2005 14:23:15 -0700 (PDT) Message-ID: <758d5e7f05052614232f6c9164@mail.gmail.com> Date: Thu, 26 May 2005 23:23:15 +0200 From: Dawid Kuroczko Reply-To: Dawid Kuroczko To: Josh Close Subject: Re: slow queries, possibly disk io Cc: pgsql-performance@postgresql.org In-Reply-To: <4a0cafe205052613242e0d4d10@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <4a0cafe205052613242e0d4d10@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.823 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, FROM_ENDS_IN_NUMS, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200505/404 X-Sequence-Number: 12568 On 5/26/05, Josh Close wrote: > I have some queries that have significan't slowed down in the last > couple days. It's gone from 10 seconds to over 2 mins. >=20 > The cpu has never gone over 35% in the servers lifetime, but the load > average is over 8.0 right now. I'm assuming this is probably due to > disk io. >=20 > I need some help setting up postgres so that it doesn't need to go to > disk. I think the shared_buffers and effective_cache_size values are > the one's I need to look at. Few "mandatory" questions: 1. Do you vacuum your db on regular basis? :) 2. Perhaps statistics for tables in question are out of date, did you try alter table set statistics? 3. explain analyze of the slow query? 4. if you for some reason cannot give explain analyze, please try to describe the type of query (what kind of join(s)) and amount of data found in the tables. 2 minutes from 10 seconds is a huge leap, and it may mean that PostgreSQL for some reason is not planning as well as it could. Throwing more RAM at the problem can help, but it would be better to hint the planner to do the right thing. It may be a good time to play with planner variables. :) Regards, Dawid