denis-stepanov / advent

Vent intrusive TV ads
GNU General Public License v3.0
14 stars 1 forks source link

Support for database vacuuming #42

Closed denis-stepanov closed 1 year ago

denis-stepanov commented 2 years ago

The database of fingerprints even of a modest size can easily have hundreds of thousands of entries. They are intensively queried by parallel threads. It is thus important to keep database small and clean to the extent possible. Manipulating database like pulling an update contributes to buildup of junk which can be removed by PostgreSQL VACUUM command. Experience shows that it may significantly improve performance. It is thus suggested to add its support to the database service tool.

denis-stepanov commented 2 years ago

Maybe a better alternative would be to turn on and tune the 'autovacuum' feature of Postgres.

denis-stepanov commented 2 years ago

It turns out that "autovacuum" is already turned on by default, but it kick in whenever PostgreSQL sees fit, and not necessarily by the end of data modifications. So the vacuum command would still make sense.

An optional -f parameter could perform VACUUM FULL.