Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Odoo database grows quickly

Naroči se

Get notified when there's activity on this post

This question has been flagged
databasepostgresqllogfileSize
7 Odgovori
14421 Prikazi
Avatar
Thicham

Hi everyone,

My odoo postgresql database size starts to grow in a fast way. today it is up to 12Gb.
Is it normal or there are some log files i have to remove or clear from time to time and which keep my database so huge.
I'm using Odoo under Ubuntu.

0
Avatar
Opusti
Avatar
Yvan
Best Answer

Hi Thicham,


I had a similar issue some months ago. The problem was located in an module that stored big binary files in the database.

I would suggest that you analyse your database to find out you which tables store a big amount of data. To do this, you can run follow query on you database:

SELECT nspname || '.' || relname AS "relation",    pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"  FROM pg_class C  LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)  WHERE nspname NOT IN ('pg_catalog', 'information_schema')    AND C.relkind <> 'i'    AND nspname !~ '^pg_toast'  ORDER BY pg_total_relation_size(C.oid) DESC  LIMIT 20;

The result of this query will show the name of the table and its disk usage for the 20 biggest tables. Once you know which tables are growing very fast you can focus the analysis on the corresponding module.

You can find useful information about disk usage under: https://wiki.postgresql.org/wiki/Disk_Usage


Best regards

Yvan

2
Avatar
Opusti
Thicham
Avtor

Thank you Yvan, you saved the day ;). It seems that product_template table that has the most data in it (11Gb out of total 12Gb). Actually i was attching the logos of the main suppliers to the corresponding products as binary files and this was the reason.

Thicham
Avtor

I did an update query on the product_template table in order to erase the value of "image_medium" and "image_small" columns, however the size of the table still not decreased.

How can i effectivelly delete those binary images from the database or from /var/lib/postgresql/9.4/main/base/my_db/ ?

Yvan

Hi Thicham, i'm glad to hear that you were able to find the source of the problem.

Now that you have deleted the a huge amount of data, you need to perform a vacuum on the database using following command:

$ vacuumdb -d <name of your database> -t product_template

After that, you database should be a few GB smaller.

If you need further information about database vacuum, try this link:

https://www.postgresql.org/docs/8.4/static/sql-vacuum.html

Avatar
Mahmoud Abdelwahid
Best Answer

Also review your attachment , May be attachment store internally as binary files

0
Avatar
Opusti
Avatar
Thicham
Avtor Best Answer

That works just fine Yvan. Thanks a lot.

0
Avatar
Opusti
Avatar
ECODIGITUS SAINS TEKNOVASI
Best Answer

For vacuum db, so All Log Note (history message) in each module will be delete too?
I Have same problem, public mail message reach 370 GB, my odoo server cannot online again.

How about this?

Thank you

0
Avatar
Opusti
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
Database Migration
database postgresql
Avatar
Avatar
1
jul. 23
6544
How to save the column of the database when deleting the module?
database postgresql
Avatar
Avatar
1
mar. 15
6237
When should Database be separated on Separate Server. Solved
server database postgresql
Avatar
Avatar
1
jul. 25
4344
Incremental backup in 2024 ? (self hosted)
database postgresql backup
Avatar
0
jun. 24
2341
Odoo Internal Server Error
database postgresql server500
Avatar
0
maj 24
1788
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now