#496 - Security Suite: securitygroups_records file very large (2,159,462 records)
My securitygroups_records table has 2.159,462 records (1.9Gb size) while the rest of the database has only 87,000 records. Is there a problem or have I implemented group features ineffectively? I would like to know if there is a way to reduce the size on disk and hence positively impact performance.
Thank you.
10 years ago
First thing to check is if you really need all of the groups that you have on each record. Try to minimize that need as much as possible. Also see if you have added some custom logic that may be adding duplicates to the table.
Then once you have cleaned that up remove all of the deleted records in securitygroups_records.
Then delete duplicates
You can find records with many groups associated to it with (change table/count as desired):
Some other things to try: 1) Upgrade to at least MySQL 5.5 if you haven't already (200-360% performance boost). 2) Reassess how groups are being used 3) Make sure InnoDB is being used as the db engine 4) Disable list count queries in SugarCRM 5) Reasses and apply tuner recommendations (https://github.com/rackerhacker/MySQLTuner-perl) 6) Optimize MySQL tables (mysqlcheck) 7) See if it's a specific module: select module, count(*) from securitygroups_records group by module; 8) Defrag the securitygroups_records table (after doing deletes):
I hope something there helps! -Jason
10 years ago
Jason,
Thank you. Your suggestions look interesting and I will give them a try. BTW we have no custom code involved, I am hoping the duplicate cleanup might be the gem I am looking for.
10 years ago
And the formatting of the reply completely got hosed. The content is there at least. Hopefully that is usable. Otherwise I can email you that same reply.
-Jason
10 years ago
Following up here as we found that the issue was due to the SchedulersJobs getting related to groups which caused the table to inflate greatly. This was fixed as of 2.7.2 (https://www.sugaroutfitters.com/docs/securitysuite/release-notes).