Re: Very slow inner join query Unacceptable latency. - Mailing list pgsql-performance

From Jaime Casanova
Subject Re: Very slow inner join query Unacceptable latency.
Date
Msg-id CAJKUy5jN1wt9f0WG3eedrR26BbbSKg3UGRX-am7DYDDfWT8=nQ@mail.gmail.com
Whole thread Raw
In response to Re: Very slow inner join query Unacceptable latency.  (<fburgess@radiantblue.com>)
List pgsql-performance
On Thu, May 23, 2013 at 12:21 PM,  <fburgess@radiantblue.com> wrote:
>
> But what negative impact is disabling hash joins?
>

doing it just for a single query, could be a tool for solving
particular problems.
setting it in postgresql.conf, therefore affecting all queries, is
like using a hammer to change tv channel... it will cause more
problems than the one it solves.

what you can do is:

1) execute:

SET enable_hashjoin TO OFF;
SELECT here
RESET enable_hashjoin TO ON;

2) in a function:

CREATE FUNCTION do_something() RETURNS bigint AS
$$
   SELECT here
$$ LANGUAGE sql SET enable_hashjoin TO OFF STABLE;

--
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación
Phone: +593 4 5107566         Cell: +593 987171157


pgsql-performance by date:

Previous
From: james
Date:
Subject: Re: Performance of complicated query
Next
From: Jonathan Morra
Date:
Subject: Re: Performance of complicated query