Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6EC06650CF5 for ; Mon, 30 Jun 2008 04:44:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 10717-10 for ; Mon, 30 Jun 2008 04:44:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.infogears.com (mail.infogears.com [69.51.90.143]) by postgresql.org (Postfix) with ESMTP id 53B96650E29 for ; Mon, 30 Jun 2008 04:44:48 -0300 (ADT) Received: from mail.infogears.com (localhost.localdomain [127.0.0.1]) by mail.infogears.com (Postfix) with ESMTP id 7F7B13098098; Mon, 30 Jun 2008 01:44:46 -0600 (MDT) Received: from (HELO site-9.labs.infogears.com) () (smtp-auth username rconover, mechanism plain) by mail.infogears.com (qpsmtpd/0.31-dev) with ESMTP; Mon, 30 Jun 2008 01:44:46 -0600 Cc: pgsql-performance@postgresql.org Message-Id: From: Rusty Conover To: Ulrich In-Reply-To: <48688B44.6070407@gmx.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v924) Subject: Re: Subquery WHERE IN or WHERE EXISTS faster? Date: Mon, 30 Jun 2008 01:44:45 -0600 References: <48665741.2060900@gmx.net> <29009.1214668423@sss.pgh.pa.us> <4866B624.1090906@gmx.net> <48688B44.6070407@gmx.net> X-Mailer: Apple Mail (2.924) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200806/226 X-Sequence-Number: 30576 On Jun 30, 2008, at 1:29 AM, Ulrich wrote: > I think it will be fast, because the "IN set", which is the result > of "SELECT processorid FROM users_processors WHERE userid=4040", is > limited to a maximum of ~500 processors which is not very big. > Increasing Postgres' RAM would be difficult for me, because I am > only running a very small server with 256MB RAM and the webserver > also likes to use some RAM. > > Does Postgre cache the HASH-Table for later use? For example when > the user reloads the website. > No the hash table only lives as long as the query is being executed. If you're looking for generic caching, I'd suggest memcached may be able to fill your needs. Cheers, Rusty -- Rusty Conover InfoGears Inc. http://www.infogears.com