Contributors mailing list archives

Browse archives


Re: Regular postgres VACUUM command

Open for Small Business, Graeme Gellatly
- 25/07/2023 22:56:33

In general, auotvaccum is a postgres setting which does that. Usually, I thought it was enabled by default.

In terms of index choice and counts, that is also a postgres setting, default_statistics_target which is probably set too low.

Of course there are myriad other postgres settings which affect what the planner does.

There are some OCA/FOSS modules I have seen over the years for logging slow queries, creating indexes etc, I've never used, but if you really want to run specific commands in Odoo, then it is simple enough with a server action as you can just do

On Wed, Jul 26, 2023 at 6:52 AM tblauwendraat <> wrote:

I'm faced with an Odoo database that is quite active and has some very big tables. I also notice that sometimes, indexes go unused and the query plans go haywire (30 secs where it could be 70ms if using a certain index)

I've learned that this could be because Postgres misestimates the size of the tables, and i should run ANALYZE on the table. VACUUM ANALYZE and other VACUUM commands can remedy this, when run regularly.

I would have expected some kind of OCA module that has scheduled actions for this, but I havent found any.

How would you / have you handle(d) this situation? Would a new OCA module be of use?

Post to: