Re: Slowness of extended protocol - Mailing list pgsql-hackers

From Vladimir Sitnikov
Subject Re: Slowness of extended protocol
Date
Msg-id CAB=Je-GUOPFMq==2EHUV8wCyVNxryoa3ia-iNQuBRRQm2hkxwA@mail.gmail.com
Whole thread Raw
In response to Re: Slowness of extended protocol  (Tatsuo Ishii <ishii@sraoss.co.jp>)
Responses Re: Slowness of extended protocol  (Tatsuo Ishii <ishii@sraoss.co.jp>)
Re: Slowness of extended protocol  (Shay Rojansky <roji@roji.org>)
Re: Slowness of extended protocol  (Shay Rojansky <roji@roji.org>)
List pgsql-hackers
Tatsuo>Interesting. What would happen if a user changes some of GUC
parameters? Subsequent session accidentally inherits the changed GUC
parameter?

Yes, that is what happens.
The idea is not to mess with gucs.

Tatsuo>There's nothing wrong with DICARD ALL
Tatsuo>"DISCARD ALL" is perfect for this goal.

It looks like you mean: "let's reset the connection state just in case".
I see where it might help: e.g. when providing database access to random people who might screw a connection in every possible way.

Just in case: do you think one should reset CPU caches, OS filesystem caches, DNS caches, bounce the application, and bounce the OS in addition to "discard all"?
Why reset only "connection properties" when we can reset everything to its pristine state?

Just in case: PostgreSQL does not execute "discard all" on its own.
If you mean "pgpool is exactly like reconnect to postgresql but faster since connection is already established", then OK, that might work in some cases (e.g. when response times/throughput are not important), however why forcing "you must always start from scratch" execution model?

Developers are not that dumb, and they can understand that "changing gucs at random is bad".

When a connection pool is dedicated to a particular application (or a set of applications), then it makes sense to reuse statement cache for performance reasons.
Of course, it requires some discipline like "don't mess with gucs", however that is acceptable and it is easily understandable by developers.

My application cannot afford re-parsing hot SQL statements as hurts performance. It is very visible in the end-to-end performance tests, so "discard all" is not used, and developers know not to mess with gucs.

Vladimir

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: WIP: Barriers
Next
From: Tom Lane
Date:
Subject: Re: Undiagnosed bug in Bloom index