Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 995466500B4 for ; Mon, 17 Nov 2008 13:40:18 -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 09350-03 for ; Mon, 17 Nov 2008 13:40:15 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by mail.postgresql.org (Postfix) with ESMTP id F311864FD92 for ; Mon, 17 Nov 2008 13:40:14 -0400 (AST) Received: by wa-out-1112.google.com with SMTP id j4so1304607wah.19 for ; Mon, 17 Nov 2008 09:40:13 -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=1zirygKjZfZ+Oi6lWtaeDcjXSsstiC3USBBB7VctTnA=; b=Tsk3/zk1BNzB8neeEIfekKKLQwnr4osPXSnm8/kjcAOXQ0okPhA2xhT/aM7R0X2jkA GVYgwzCvPL7bSFDmpdq+U2wr0EryQ/ZZijw24VQoTekvOFUxULxvWgcGP8/wohSC0nj3 JsU4aC4M/3scSFQAitvXLJRS6uHSG5SiO1ruU= 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=sT63fKYNnsjuqsOnQ0xwmhHpyZV8eq2tK6+l0dQ1hUL8TbSIpLQpU7r3SBJRtnKwRH /tnYLnEboYSieL6FCrzxAFnEKCDQoKfg1Y+hcS+zf21q7Yl9mcloz6qGFg3J6LIqbz4f dHiXYI1pyA+bmn9u02svG6hcDeIBwpY2Wi1R8= Received: by 10.114.201.1 with SMTP id y1mr2649413waf.23.1226943613272; Mon, 17 Nov 2008 09:40:13 -0800 (PST) Received: by 10.114.137.14 with HTTP; Mon, 17 Nov 2008 09:40:12 -0800 (PST) Message-ID: Date: Mon, 17 Nov 2008 10:40:12 -0700 From: "Scott Marlowe" To: "Dimi Paun" Subject: Re: Bad performance on simple query Cc: pgsql-performance In-Reply-To: <1226943062.5760.103.camel@dimi.lattica.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1226937197.5760.89.camel@dimi.lattica.com> <1226941621.5760.97.camel@dimi.lattica.com> <1226943062.5760.103.camel@dimi.lattica.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: 200811/151 X-Sequence-Number: 31882 On Mon, Nov 17, 2008 at 10:31 AM, Dimi Paun wrote: > > On Mon, 2008-11-17 at 10:16 -0700, Scott Marlowe wrote: >> Ahhh. Keep in mind that if you just run the query, pgadminIII will >> tell you how long it took to run AND return all the data across the >> network, so it will definitely take longer then. But most of that's >> network io wait so it's not a real issue unless you're saturating your >> network. > > But that is brutal -- there's no way it can take 20ms for a request > across an unloaded network. > > Moreover, I got something like this: > > pgadminIII | pgsql > w/o index: 45ms 0.620ms > w/ index 20ms 0.091ms > > How now I try to replicate, and I get 45ms in both cases. This is > very misleading... I'm guessing a fair bit of that time is pgadminIII prettifying the output for you, etc. I.e. it's not all transfer time. Hard to say without hooking some kind of profiler in pgadminIII. Is psql running local and pgadminIII remotely? Or are they both remote? If both psql and pgadminIII are remote (i.e. same basic circumstances) then it's got to be a difference in the client causing the extra time. OR is this output of explain analyze?