From: Tom Lane <tgl@sss.pgh.pa.us>
To: Brian Fehrle <brianf@consistentstate.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: two table join just not fast enough.
Date: Wed, 02 Nov 2011 19:53:02 -0400
Message-ID: <29294.1320277982@sss.pgh.pa.us> (raw)
In-Reply-To: <4EB1A419.1080901@consistentstate.com>
References: <4EB1A419.1080901@consistentstate.com>
Brian Fehrle <brianf@consistentstate.com> writes:
> I've got a query that I need to squeeze as much speed out of as I can.
Hmm ... are you really sure this is being run with work_mem = 50MB?
The hash join is getting "batched", which means the executor thinks it's
working under a memory constraint significantly less than the size of
the filtered inner relation, which should be no more than a couple
megabytes according to this.
I'm not sure how much that will save, since the hashjoin seems to be
reasonably speedy anyway, but there's not much other fat to trim here.
One minor suggestion is to think whether you really need string
comparisons here or could convert that to use of an enum type.
String compares ain't cheap, especially not in non-C locales.
regards, tom lane
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: tgl@sss.pgh.pa.us, brianf@consistentstate.com
Subject: Re: two table join just not fast enough.
In-Reply-To: <29294.1320277982@sss.pgh.pa.us>
* 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