Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id ED00864FD71 for ; Wed, 17 Dec 2008 10:50:51 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 89312-04 for ; Wed, 17 Dec 2008 10:50:49 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f19.google.com (mail-bw0-f19.google.com [209.85.218.19]) by mail.postgresql.org (Postfix) with ESMTP id C4CE364FD3B for ; Wed, 17 Dec 2008 10:50:48 -0400 (AST) Received: by bwz12 with SMTP id 12so1112319bwz.19 for ; Wed, 17 Dec 2008 06:50:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; 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=kVOFhYrDD/Oy5j1jwkgU5LutHJeptcOaMwSS7Ar1Vmo=; b=vcYWpDduTu83QB5sdxCnBUsqso3m4Qu7+9JC52J+qIivN6bWTES1R+cYzUbzcI4QHR TUQ0ifJ79O94dURqIUQl9s4lM2WSYInCyAjjNKV21RAgBxC/y96b8N9ts4hg6bR5rYrs jcgRst1IPp6UyMzMq5HZzH9RGqig4BhFa6obU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=PndRsPW/D7yNlFpSd8xcKnduLvq1r8lfdzsLCX2eaXwd1kD6MiaBEjNJUBdb/08MZT SFboyuqwmTsKT4W15tNTG/YAfiYNTXa/5VdMeM9KK6StaVNtKDi/GW4yzHAIbdJy8Fi4 r/kB7SFW9454FgQkjQAvMlL3KdSKhzWCSdlNQ= Received: by 10.103.106.1 with SMTP id i1mr307147mum.0.1229525366179; Wed, 17 Dec 2008 06:49:26 -0800 (PST) Received: by 10.103.131.10 with HTTP; Wed, 17 Dec 2008 06:49:26 -0800 (PST) Message-ID: Date: Wed, 17 Dec 2008 09:49:26 -0500 From: "Merlin Moncure" To: "Jaime Casanova" Subject: Re: measure database contention Cc: "psql performance list" In-Reply-To: <3073cc9b0812161132w3ae157a8n69e2b0cccea05ca2@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3073cc9b0812161132w3ae157a8n69e2b0cccea05ca2@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200812/161 X-Sequence-Number: 32197 On Tue, Dec 16, 2008 at 2:32 PM, Jaime Casanova wrote: > Hi, > > we have a some bad queries (developers are working on that), some of > them run in 17 secs and that is the average but when analyzing logs i > found that from time to time some of them took upto 3 mins (the same > query that normally runs in 17secs). > > so my question is: how could i look for contention problems? Sometimes queries can have fluctuating plans. For example this can happen if you have sorts or hashes that are very near the allowed limit set in work_mem. so you want to catch it both ways via explain analyze. merlin