Skip to content

Correcting the UTF8 conversion

dcheng edited this page Apr 27, 2011 · 3 revisions

The previously posted script switched to many unnecessary fields to UTF8. This seems to have degrade performance considerably as the size of the tables increased dramatically. (3x more space is allocated for every field in UTF8 when compared to latin1). To revert to 'latin1' charset and only change the most necessary fields, run the following script, just change the first line to fit the name of your database.

alter database openfire charset=latin1;

alter table ofUser charset=latin1;

ALTER TABLE ofUser CONVERT TO CHARACTER SET latin1;

alter table AtomPerson charset=latin1;

ALTER TABLE AtomPerson CONVERT TO CHARACTER SET latin1;

alter table FullNameField charset=latin1;

ALTER TABLE FullNameField CONVERT TO CHARACTER SET latin1;

alter table NameField charset=latin1;

ALTER TABLE NameField CONVERT TO CHARACTER SET latin1;

alter table NoteField charset=latin1;

ALTER TABLE NoteField CONVERT TO CHARACTER SET latin1;

alter table Activities charset=latin1;

ALTER TABLE Activities CONVERT TO CHARACTER SET latin1;

alter table AtomContent charset=latin1;

ALTER TABLE AtomContent CONVERT TO CHARACTER SET latin1;

alter table AtomEntry charset=latin1;

ALTER TABLE AtomEntry CONVERT TO CHARACTER SET latin1;

alter table Objects charset=latin1;

ALTER TABLE Objects CONVERT TO CHARACTER SET latin1;

alter table Relation charset=latin1;

ALTER TABLE Relation CONVERT TO CHARACTER SET latin1;

alter table ofUser change name name VARCHAR(100) character set utf8;

alter table AtomPerson change name name VARCHAR(255) character set utf8;

alter table FullNameField change fullName fullName VARCHAR(255) character set utf8;

alter table NameField change given given VARCHAR(255) character set utf8;

alter table NameField change surname surname VARCHAR(255) character set utf8;

alter table NameField change prefix prefix VARCHAR(255) character set utf8;

alter table NameField change suffix suffix VARCHAR(255) character set utf8;

alter table NoteField change note note VARCHAR(255) character set utf8;

alter table Activities change title title VARCHAR(255) character set utf8;

alter table AtomContent change value value VARCHAR(255) character set utf8;

alter table AtomEntry change title title VARCHAR(255) character set utf8;

alter table Objects change title title VARCHAR(255) character set utf8;

alter table Relation change comment comment VARCHAR(255) character set utf8;

alter table Relation change guid guid VARCHAR(255) character set utf8;

alter table Relation change nature nature VARCHAR(255) character set utf8;

alter table Relation change origin origin VARCHAR(255) character set utf8;

alter table Relation change owner owner VARCHAR(255) character set utf8;

alter table Relation change status status VARCHAR(255) character set utf8;

alter table Relation change target target VARCHAR(255) character set utf8;