[ZBX-11484] Drop OID's on Postgres databases after update Created: 2016 Nov 15 Updated: 2018 Apr 29 Resolved: 2018 Apr 29 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | None |
Affects Version/s: | 2.0.19, 2.2.15 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Trivial |
Reporter: | D.Spindel Ljungmark | Assignee: | Unassigned |
Resolution: | Unsupported version | Votes: | 1 |
Labels: | dbpatches, performance, postgres | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
PostgreSQL server |
Description |
Zabbix 1.8 and maybe 2.x created the default tables in Zabbix with OID's explicitly enabled. The OID isn't used, and isn't created with modern Zabbix installations, and OID's should be dropped from the PostgreSQL instances when upgrading. Removing OID from a Postgres table involves locking the table for reads & Writes, and will re-write the entire table & indexes. This process can be. very long, especially with a lot of history or trends in the tables. For our system it was several hours, and the database shrunk with almost 60%! |
Comments |
Comment by Oleksii Zagorskyi [ 2016 Nov 15 ] |
I've never noticed the difference in PG zabbix databases. CREATE TABLE slideshows ( slideshowid bigint DEFAULT '0' NOT NULL, name varchar(255) DEFAULT '' NOT NULL, delay integer DEFAULT '0' NOT NULL, PRIMARY KEY (slideshowid) ) with OIDS; 2.0 already does not have it. It could be fixed with upgrade patches, but ... the time required is a serious aspect. In a |
Comment by Oleksii Zagorskyi [ 2016 Nov 15 ] |
Issue moved to ZBX project, as it's closer to a bug. |
Comment by D.Spindel Ljungmark [ 2016 Nov 15 ] |
The graph on that blog post is for the OID drop only. I'm expecting another 40% disk usage drop by implementing the changes from So yes, OID dropping alone caused a 60% reduction on one of our DB machines. I expect that is because those tables were slightly bloated, and a normal expectation would be 15-20% reduction due to OID. |
Comment by JB [ 2017 Sep 21 ] |
I reduced my database size by almost 50% after removing the oid from my database. |
Comment by Glebs Ivanovskis (Inactive) [ 2018 Apr 29 ] |
Since the issue only affects versions ≤1.8 upgrading to a newer versions and 1.8 is out of support for quite some time, I'm closing this issue as Unsupported version. |