Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Some slow sql queries

  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
6 months 3 weeks ago #250858 by Jmantysalo
Some slow sql queries was created by Jmantysalo
An area for sysadmins does not exists, so I ask here. I put on logging slow sql queries. Here is an example that took 22 seconds:
Code:
SELECT t.uid AS t0_c0, t.users_name AS t0_c1, t.password AS t0_c2, t.full_name AS t0_c3, t.parent_id AS t0_c4, t.lang AS t0_c5, t.email AS t0_c6, t.htmleditormode AS t0_c7, t.templateeditormode AS t0_c8, t.questionselectormode AS t0_c9, t.one_time_pw AS t0_c10, t.dateformat AS t0_c11, t.last_login AS t0_c12, t.created AS t0_c13, t.modified AS t0_c14, t.validation_key AS t0_c15, t.validation_key_expiration AS t0_c16, t.last_forgot_email_password AS t0_c17, t.expires AS t0_c18, permissions.id AS t1_c0, permissions.entity AS t1_c1, permissions.entity_id AS t1_c2, permissions.uid AS t1_c3, permissions.permission AS t1_c4, permissions.create_p AS t1_c5, permissions.read_p AS t1_c6, permissions.update_p AS t1_c7, permissions.delete_p AS t1_c8, permissions.import_p AS t1_c9, permissions.export_p AS t1_c10 FROM lime_users t LEFT OUTER JOIN lime_permissions permissions ON (permissions.uid=t.uid) WHERE (((permissions.permission='superadmin') AND (permissions.read_p='1')) OR (t.uid=1));

And here is EXPLAIN of it+
+
+
+
+
+
+
+
+
+
+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+
+
+
+
+
+
+
+
+
+
+
| 1 | SIMPLE | t | ALL | PRIMARY | NULL | NULL | NULL | 1686 | |
| 1 | SIMPLE | permissions | ALL | NULL | NULL | NULL | NULL | 35429 | Using where; Using join buffer (flat, BNL join) |
+
+
+
+
+
+
+
+
+
+
+No index and 35000 rows sounds bad. But I can't catch when this happens, i.e. sometimes the system is slow and sometimes not. Anything I can do to make this faster?
 

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 months 1 week ago #251229 by DenisChenu
Replied by DenisChenu on topic Some slow sql queries
I think such issue must be reported as issue community.limesurvey.org/bug-tracker/

I create a DB indexor plugin : gitlab.com/SondagesPro/coreAndTools/DbIndexManage

But more for testing performance : if you test same and have really a better : we can add it too.

but here : there are more issue than index i think.

I don't understand why we search all superadmin here ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose