TOPIC: Contact Detail View takes long time to load when Cases subpanel is enabled - Works fine when hidden

The detail view takes a good few seconds in the order 15-20 seconds to load when the cases subpanel is enables. When we hide the subpanel under Admin -> Display Modules and Subpanels, the detail view now loads near instantly.

We have a large number of cases and notes associated.

Investigating the log files by isolating to just one use and one record it appears that when the cases subpanel is enabled there are a very large number of queries in the form

I can confirm that the pattern is repeated for all 1057 notes. None of that information is actually needed.

I tried editing the Cases module subpanel/default.php to only show case number thinking that the assigned to and account is somehow triggering all those queries. Tt does not have any affect and these, for this purposes is unnecessary, queries are being executed.

The history panel does not seem to be affected in anyway and the notes entries there are not affected irrespective of the having that Cases subpanel enabled or hidden.

4. What are your results when running the query at the top of this post?

pgorod.github.io/Database-tables-size/

You were supposed to go get an SQL query from that link and execute it, I don't think you saw that

If you don't "prune" regularly and automatically, you should prune occasionally and manually. You can start by running queries on all your larger tables like this:

SELECT YEAR(date_modified), COUNT(*) FROM `leads`
WHERE deleted=1
GROUP BY YEAR(date_modified)

You can then turn those into DELETE queries, deleting everything, or everything except the current month, for example.

Then you should examine orphaned records. For example, when you delete a Contact, there could still be an entry for it in contacts_cstm, or security_groups_records, for example.

Then clear up tracking tables like job_queue or aow_processed. These cleanups require some care - delete only finished jobs, and delete only AOW information that is not relevant to any Workflows you are using which have "Repeated runs" unchecked (these need to keep track of past actions in order to function well).