Skip site navigation (1) Skip section navigation (2)

Re: disabling seq scans

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Marcus Andree S(dot) Magalhaes" <marcus(dot)magalhaes(at)vlinfo(dot)com(dot)br>
Cc: shannyconsulting(at)earthlink(dot)net, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: disabling seq scans
Date: 2004-04-02 04:16:21
Message-ID: 17602.1080879381@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-jdbc
"Marcus Andree S. Magalhaes" <marcus(dot)magalhaes(at)vlinfo(dot)com(dot)br> writes:
> But, since we're using pooled connections, we must be extra
> careful and ensure all connections have the enable_seqscan
> reset to its default.

If you are concerned about failing to reset parameters, use "SET LOCAL
foo" instead of plain "SET foo" (and of course, do this inside a
transaction block).  With the LOCAL option the parameter is guaranteed
to be reset at transaction end.

> Do the pooling system resets the "enable_seqscan" variable
> when the connections are delivered to the clients or we
> *must* do it ourselves?

I think it is reasonable to expect a pooling system to deliver you a
fresh transaction.  It is not reasonable to expect it to go and issue
explicit SET commands to undo things you've done.

			regards, tom lane

In response to

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2004-04-02 06:55:04
Subject: Re: patch: enforce the requirements for scrollable resultsets
Previous:From: Sanjay SinghDate: 2004-04-02 03:42:59
Subject: Un-register

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group