Answer the question
In order to leave comments, you need to log in
What happens if you stop working with the connection to postgres, while leaving the transaction open?
I am translating an article about error handling in Node.js. The article provides an example of working with the postgres database.
Since I have no experience with postgres, there were doubts that I understood it correctly. Please clarify the following paragraph:
Postgres connection may be left inside an open transaction. This causes postgres to "hang on" to old versions of rows in the table because they may be visible to that transaction. This can stay open for weeks, resulting in a table whose effective size grows without bound - causing subsequent queries to slow down by orders of magnitude - from a few milliseconds to a minute.
Answer the question
In order to leave comments, you need to log in
This means that older row versions that are visible to this transaction cannot be purged with the VACUUM command. In this case, the database will become more and more "littered", as a result of which the execution of queries will slow down.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question