Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 929FF2E0060 for ; Thu, 27 Mar 2008 01:57:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 49781-08 for ; Thu, 27 Mar 2008 01:57:12 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by postgresql.org (Postfix) with ESMTP id 402772E0057 for ; Thu, 27 Mar 2008 01:57:12 -0300 (ADT) Received: by wa-out-1112.google.com with SMTP id m38so4635118waf.5 for ; Wed, 26 Mar 2008 21:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=pEcayROq0zNPa/yJvoArL0UYDAVTkKVoreVO6ylOwo0=; b=mBYaORY+5BT2jmlOev/CUDM0ES3pECifNUtXrpLzrZimw3yfXs/8YmxyUkKV15JBI214D0FfZaHyIAT2YxFmlpikz+Ob/EyhBg85zQ1GDKAB0fkwWR8rgwAj8CE5rux4QGQsAQRYZ0QCFORCfLvRj7B4Aj+PDvP1+46j9f2u5uE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=H+ewT2i0s0JSkoYplTdjM5t2f3t0/cUfPwbnRaSGA5VDNqJRGRM6YG0M0/qho83D03nG5s2r/tcCumI5ZOXxYOi7crBMo9xxm0492n2lKEpPaAWG/jTvKCIfZGBuUlKJIGWrAo5loAsW6dPu0aKYrexb2gorbajNUPmfEoqLt6Y= Received: by 10.114.254.1 with SMTP id b1mr627033wai.132.1206593831471; Wed, 26 Mar 2008 21:57:11 -0700 (PDT) Received: by 10.114.137.7 with HTTP; Wed, 26 Mar 2008 21:57:11 -0700 (PDT) Message-ID: Date: Wed, 26 Mar 2008 22:57:11 -0600 From: "Scott Marlowe" To: "Shane Ambler" Subject: Re: how can a couple of expensive queries drag my system down? Cc: "p prince" , pgsql-performance@postgresql.org In-Reply-To: <47EB1DE9.5010507@Sheeky.Biz> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <9722e78e0803261248g3305c2b9yfd5cfd528a505150@mail.gmail.com> <47EB1DE9.5010507@Sheeky.Biz> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/499 X-Sequence-Number: 29453 On Wed, Mar 26, 2008 at 10:09 PM, Shane Ambler wrote: > Scott Marlowe wrote: > > On Wed, Mar 26, 2008 at 1:48 PM, p prince wrote: > >> is this 'normal'? (loaded question I know) > >> Should I be looking to offload expensive reporting queries to read-only > >> replicants of my database? > > > > Yes, definitely look into setting up something like a slony slave > > that's used for reporting queries. The nice thing about this setup is > > you only need to replicate the tables you run reports against. > > > > I would look at fixing the slow queries so that they aren't a problem first. I'm not sure you're reading the same thread as me. Or something. I've had reporting queries that took the better part of an hour to run, and this was completely normal. When you're running millions of rows against each other for reporting queries it's not unusual to blow out the cache. Maybe the queries are inefficient, and maybe they're not. But one should not be running reporting queries on a live transactional database. > > I'm sure if you send in your queries and table defs you can get some > useful feedback here. > > If there is no way of improving them then look at a reporting slave. > > > -- > > Shane Ambler > pgSQL (at) Sheeky (dot) Biz > > Get Sheeky @ http://Sheeky.Biz >