pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tv@fuzzy.cz>
To: Andy Colson <andy@squeakycode.net>
Cc: Craig Ringer <ringerc@ringerc.id.au>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: IN or EXISTS
Date: Wed, 31 Aug 2011 16:19:36 +0200
Message-ID: <cf12201c9c3aa4a29a5c2ed26c7853ce.squirrel@sq.gransy.com> (raw)
In-Reply-To: <4E5E3E5F.4000807@squeakycode.net>
References: <4E5D485F.8060300@squeakycode.net>
	<4E5D8F68.4010102@ringerc.id.au>
	<4E5E3E5F.4000807@squeakycode.net>

On 31 Srpen 2011, 15:59, Andy Colson wrote:
> I assume:
> Buckets: 16384  Batches: 1  Memory Usage: 4531kB
>
> That means a total of 4.5 meg of ram was used for the hash, so if my
> work_mem was lower than that it would swap?  (or choose a different plan?)

Why don't you try that? Just set the work_mem to 1MB or so and run the query.

I think it'll use the same plan but multiple batches - read just part of
the inner table so that the hash table fits into work_mem, scan the outer
table etc. The downside is it'd rescan the outer table several times.

Tomas




view thread (5+ messages)  latest in thread

Message-ID: <cf12201c9c3aa4a29a5c2ed26c7853ce.squirrel@sq.gransy.com>
Permalink:  ../cf12201c9c3aa4a29a5c2ed26c7853ce.squirrel@sq.gransy.com/
Also on:    postgresql.org/message-id/cf12201c9c3aa4a29a5c2ed26c7853ce.squirrel@sq.gransy.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tv@fuzzy.cz, andy@squeakycode.net, ringerc@ringerc.id.au
  Subject: Re: IN or EXISTS
  In-Reply-To: <cf12201c9c3aa4a29a5c2ed26c7853ce.squirrel@sq.gransy.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox