Slow SearchPanes: Do I always have to return all searchPanes options from server if count is 0?
Slow SearchPanes: Do I always have to return all searchPanes options from server if count is 0?
I have seen in the editor server libraries that you always determine all labels, even if SearchPane options are already selected:
First query (slow):
SELECT DISTINCT phone
as 'label', phone
as 'value' FROM users
LEFT JOIN sites
ON sites
.id
= users
.site
GROUP BY phone
and then (fast):
SELECT DISTINCT phone
as 'value', COUNT(*) as count FROM users
LEFT JOIN sites
ON sites
.id
= users
.site
WHERE (users
.first_name
= :where_1 ) GROUP BY phone
The problem is that (for me) MySQL takes 0.1 seconds to select the labels per 100,000 data records. Per field! Even though an index is used. With 1,000,000 data records and 10 fields in the DataTable, this is already 10 seconds loading time just for the SearchPanes labels!
Is this really necessary if you have deactivated "viewTotal" and only a few options are displayed? If I have switched off "cascadePanes", the panes are not updated anyway. And if it is switched on, all entries with count = 0 are not displayed. Why do they still have to be transmitted by the server?