Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 109222E002C for ; Thu, 10 Apr 2008 13:37:56 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 63185-04 for ; Thu, 10 Apr 2008 13:37:50 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.186]) by developer.postgresql.org (Postfix) with ESMTP id EB7822E007E for ; Thu, 10 Apr 2008 13:37:49 -0300 (ADT) Received: by rn-out-0910.google.com with SMTP id e11so98113rng.17 for ; Thu, 10 Apr 2008 09:37:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; bh=fICmHSLtz+NgATZ16Xhm6I2JrV7umMIQaPpDERjRHjw=; b=BgoxZcckjeAJZKTtVajS8C5JY55vOlaiPM/r08sptnCPeWMTAokP9lFLediq/iFwYCgSR7O9vGiuSj1X39KiM9lKgRAmU93ub7+pB0PGLxCphvNv4LtoJ9HRMWs/KR5kzcqHYnc6pixJQu8Ii8ozZL0noWjIGzwBOAMH6rssM20= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=HuABxwtQ1MdHxyW9gYizca5tuFj7AAAbMGco9rld+RbXzGDW6e60Vtp0lUm/WBYT4HECcG4RrdQb77rnWDizAizkDfHti6+Xt6Iravr8FdBzBsJ+g4oGYSlFzO2fUFIJ9oFY7g6UQrJuSnAHdLpyLyRJyigEKqfDrkPtJ1oBozc= Received: by 10.114.53.18 with SMTP id b18mr1851795waa.157.1207845468077; Thu, 10 Apr 2008 09:37:48 -0700 (PDT) Received: from john-beavers-macbook-pro-2.local ( [68.61.222.17]) by mx.google.com with ESMTPS id i16sm3291368wxd.30.2008.04.10.09.37.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 10 Apr 2008 09:37:46 -0700 (PDT) Message-ID: <47FE4259.7030704@gmail.com> Date: Thu, 10 Apr 2008 12:37:45 -0400 From: John Beaver User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: Gaetano Mendola , Pgsql-Performance Subject: Re: large tables and simple "= constant" queries using indexes References: <47FD2DF3.80500@gmail.com> <47FD3350.4060504@tweakers.net> <47FD4212.8040404@gmail.com> <47FDBE23.8020402@tweakers.net> <47FE27EB.8050804@gmail.com> <47FE3DC7.4010700@gmail.com> In-Reply-To: <47FE3DC7.4010700@gmail.com> Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.837 tagged_above=0 required=5 tests=AWL=-0.837, HTML_MESSAGE=0.001, MIME_HTML_ONLY=1.672 X-Spam-Level: X-Archive-Number: 200804/132 X-Sequence-Number: 29625 Thanks Eric and Gaestano - interesting, and both examples of my naivite. :)

I tried running large select(*) queries on other tables followed by another try at the offending query, and it was still fast. Just to be absolutely sure this is a scalable solution, I'll try restarting my computer in a few hours to see if it affects anything cache-wise.


Gaetano Mendola wrote:
John Beaver wrote:

  
- Trying the same constant a second time gave an instantaneous result,
I'm guessing because of query/result caching.
    

AFAIK no query/result caching is in place in postgres, what you are experiencing
is OS disk/memory caching.


Regards
Gaetano Mendola