Re: Changing tuning parameters with EXPLAIN

From: Antonio Carlos Salzvedel Furtado Junior <acsfj08(at)inf(dot)ufpr(dot)br>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Changing tuning parameters with EXPLAIN
Date: 2012-06-04 21:10:03
Message-ID: CAERqmVrAxxz9yLVczWb6g9bjov=04idCjRo+YE2-rLWaL2Mm7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Thanks for the explanation.
I think I misunderstood the SET behaviour. It's OK if only my session is
affected.

Regards,
Antonio Carlos Furtado

On Mon, Jun 4, 2012 at 6:01 PM, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:

> On Mon, 2012-06-04 at 17:49 -0300, Antonio Carlos Salzvedel Furtado
> Junior wrote:
> > Hello PostgreSQL users,
> >
> > I've been working with the estimated cost from EXPLAIN. I was
> > wondering if I could change the tuning parameters, to produce new
> > estimated costs, without interfering with the database workload. Is it
> > possible?
> >
> > I'm changing these parameters by executing SQL queries ("SET"). The
> > problem is that once I change these parameters, the query optimizer
> > will start using these values to build their query plans.
>
> If you issue a SET, it only affects queries executed in your connection
> (the session). So this is safe for EXPLAINing queries. If you do a "SET
> LOCAL" within a transaction, it will only affect that transaction.
>
> To make the values persist and get picked up by other connections, you
> need to set them in postgresql.conf and send a SIGHUP (or restart, of
> course).
>
> Regards,
> Jeff Davis
>
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Ioannis Anagnostopoulos 2012-06-05 15:54:59 Partitions are not excluded in stored procedures
Previous Message Jeff Davis 2012-06-04 21:01:08 Re: Changing tuning parameters with EXPLAIN