Does creating readOnly connections, when possible, free up resources in Postgres?

Started by David Kremerabout 7 years ago1 messagesgeneral
Jump to latest
#1David Kremer
jkorders@gmx.com

<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>I have an API server and I&#39;m trying to be conscientious managing Postgres&#39;s resources carefully. On the client side, I have a Hikari Pool.</div>

<div><br/>
Usually when I need a connection, I simply create a default read/write connection, even if I don&#39;t plan to make any updates or inserts or hold any locks. But most of my database connections are in fact read-only.</div>

<div>&nbsp;</div>

<div>I saw that when you create a JDBC connection, you can specify&nbsp;<code>readOnly=true</code>. Would doing so somehow help Postgres manage its other connections? Perhaps Postgres, knowing that a connection is&nbsp;<code>readOnly</code>&nbsp;and will never even attempt to do an update, will free up some internal resources for other connections. Is this accurate?</div>

<div>&nbsp;</div></div></body></html>