Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Enormous amount of sql queries when logged in as Super Admin

Status Resolved
Add-on / Version Publisher 1.2.2
Severity Critical
EE Version 2.8.0

Es Kay

Mar 18, 2014

Hi,

I’ve been testing Publisher for a multilingual site I might develop and I’m totally impressed by the possibilities it provides! Well, except for one thing..
When logged in as a Super Admin the CP crawls literally making the back-end administration not possible.
I watched the Output Profiler and realized that Publisher is making countless sql queries for each custom field on each CP page load, even if not (at least obviously) required for that specific CP page..
I’m talking about 350+ queries just to load the CP Home.
When I try to edit a custom field it does over 650!

The specific site is a demo one to showcase to a client as a proof of concept with 24 channels consisting of almost 300 custom fields.
Yes, I know that it probably should be re-modeled and optimized but that doesn’t justify the number of queries and specifically for pages that shouldn’t require these Publisher data to be loaded from the db.
And in addition to that, why the CP works fine for non-Super Admins?

When I login as a non-SuperAdmin user everything works great. Even with user accounts that belong to a full-privilleged membergroup based on SuperAdmins.
When you publish on a channel with a myriad custom fields it takes about 60-80 queries and 4-8 secs to load the edit screen but this is totally accepted.
As a Super Admin, the same page takes more than 400 queries and 25-40 secs to load.

Another thing I noticed is that even though the script execution time (at the CP footer) is about 8 secs for an average CP page, the actual page needs more than 15 additional secs to be fully loaded.
This is pointing me to some js/css loading bottleneck.
And again, this is happening only for Super Admins.

I should also mention that there are many other 3rd party addons installed that may interfere with Publisher (especially on the js/css loading domain) but while trying to debug this problematic behavior, everything is pointing to Publisher doing unnecessary stuff behind the scenes.
I tried disabling many of them and even though the speed of the CP was improved, when I temporarily disabled Publisher every question came to a closure. The CP got breathing again and page loading times were very fast (like I was not logged in as a Super Admin).

What does Publisher do when you are logged in a as a Super Admin that doesn’t on all other membergroups (even on membergroups with full privilleges)?

Thanks in advance

#1

BoldMinded (Brian)

Es, Publisher has to add extra queries to do what it does, however, that does seem like a lot. If you get different amounts of queries depending on the member group please provide a copy/paste list of all the queries for each group so I can see what you’re referring to. I can debug on my side, but seeing exactly what you are seeing will help expedite the issue.

#2

BoldMinded (Brian)

You can send me a dropbox link or attach the queries as a text file to this ticket.

#3

Es Kay

Hi, here are some sql queries to checkout https://www.dropbox.com/s/1ii6z1eq4za572j/EE_sql_debug_for_Boldminded.zip

#4

BoldMinded (Brian)

Thanks for sending those. It looks like the Publisher_model::column_exists() method is the culprit. The other excessive calls are to Field_model::get_fields() and Template_model::get_templates(), neither of which Publisher calls. Everything else seems normal. I’m emailing a new build that should lessen the number of calls to column_exists(). Let me know if it improves anything.

#5

Es Kay

The 1.2.3 build did the trick! Everything is back to normal now. Thank you for the immediate response

Login to reply