Odoo Database Performance: When Your Instance Starts Slowing Down
Response times creeping up? Cron jobs taking longer? Here's the performance investigation playbook for Odoo database issues.
Performance degradation in Odoo is usually gradual — response times increase by a few milliseconds per week, cron jobs take slightly longer each month. By the time users start complaining, the underlying issue has been growing for months.
Common Performance Killers
1. Database Bloat
PostgreSQL doesn't automatically reclaim space from deleted or updated rows. Without regular VACUUM operations, tables grow continuously. The ir_attachment, mail_message, and ir_logging tables are the worst offenders.
2. Missing Indexes
Custom modules often add fields used in search filters and report queries without adding database indexes. A single missing index on a frequently queried field can make a report go from 2 seconds to 2 minutes.
📊 Curious about your Odoo instance health? Try the free NonaGuard health check — results in 60 seconds, no signup required.
3. ORM Misuse in Custom Code
The most common ORM performance issues in custom modules:
- N+1 queries: Looping over records and accessing relational fields one at a time instead of prefetching
- Unbounded searches:
self.env['sale.order'].search([])without a limit on a table with millions of records - Computed fields without store: Recomputed on every read instead of stored
4. Module Overload
Each installed module adds startup time, menu items, access rules, and scheduled actions. We've seen instances with 200+ modules where half are unused — installed during evaluation and never removed.
Diagnosis Steps
- Check database size growth trend —
SELECT pg_database_size('your_db'); - Identify largest tables — often reveals data retention issues
- Enable PostgreSQL slow query logging for queries taking over 1 second
- Run
VACUUM ANALYZEand compare before/after performance - Use NonaGuard's performance scanner to identify ORM anti-patterns in custom code
Run a free performance audit on your Odoo database.
📡 Get Your Pulse Score
NonaGuard provides continuous Odoo health monitoring with a 0-100 Pulse Score. Know exactly where your instance stands — no guesswork, no manual audits.