Re: Discarding DISCARD ALL - Mailing list pgsql-hackers

From Vladimir Sitnikov
Subject Re: Discarding DISCARD ALL
Date
Msg-id CAB=Je-EqLDTSRp+HSL3wS83xgJ=8i5BmdoPkdz6_=vUvZCOuCQ@mail.gmail.com
Whole thread Raw
In response to Discarding DISCARD ALL  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Discarding DISCARD ALL
List pgsql-hackers
Simon>It seems strange to me that we put this work onto the pooler, forcing
Simon>poolers to repeatedly issue the same command

What if poolers learn to manage connections and prepared statements better?
Then poolers won't have to reset the session every time, and everyone wins.

Simon>This has an additional side benefit: if we know we will clean up at
Simon>the end of the transaction, then all temp tables become effectively ON
Simon>COMMIT DROP

The ability to use the temporary tables sounds cool, however, server-prepared statements
allow improve performance significantly (both at frontend and backend), so I would not treat
"server_reset_query=discard all" as a best practice.
That is why transaction_cleanup=on (discard everything at transaction finish) seems to be a workaround
rather than a best practice for the future.

Just to clarify: the patch seems to be small, so it looks harmless, however, I would not be that
enthusiastic with tying new features with transaction_cleanup=on.

---

What do you mean by "session cleanup"?
Does that always have to be the same as "discard all"?
What if the user wants "deallocate all" behavior?
Should transaction_cleanup be an enum rather than on/off?

Vladimir

pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: postgres_fdw - cached connection leaks if the associated user mapping/foreign server is dropped
Next
From: Pavel Stehule
Date:
Subject: Re: proposal - support tsv output format for psql