There are many ways to optimize the current implementation. Which ones are useful often depends on the way applications use the data. In this issue we gather all ideas on how to improve performance.
Using PreparedStatements and ParametrizedQueries might have some performance benefits.
Adding the option to not use history tables might be good for performance in case you do not need history. Thus would mean not using history tables at all.
Splitting the current history table that contains all rows including historical ones into two separate tables. One table for the current data, and another table for all historical data. These tables can be seen as one table using Postgres table inheritance
There are many ways to optimize the current implementation. Which ones are useful often depends on the way applications use the data. In this issue we gather all ideas on how to improve performance.