Advertisement:

Author Topic: Continuous locale query?  (Read 235 times)

WEBmods

  • Hero Member
  • *****
  • Posts: 937
  • github.com/webmods-croatia/love-osclass/ | patrick
Continuous locale query?
« on: April 25, 2019, 12:16:38 am »
Hello,

Does anyone know if it's normal for these two locale queries to run very frequently (they keep running one after other in queries.log):

Code: [Select]
SELECT pk_c_code, s_name, s_short_name, s_description, s_version, s_author_name, s_author_url, s_currency_format, s_dec_point, s_thousands_sep, i_num_dec, s_date_format, s_stop_words, b_enabled, b_enabled_bo
FROM (gsti_t_locale)
WHERE pk_c_code = 'en_US'

----

SELECT *
FROM (gsti_t_locale)
WHERE b_enabled = 1
ORDER BY s_name ASC

I think it's overflowing the database... I know I can try to disable plugins and themes to check but I want an opinion on this first.

Thanks, regards.

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Continuous locale query?
« Reply #1 on: April 25, 2019, 10:47:41 am »
When it comes to SQL, there are things that may affect them like query cache and query optimizer, both are within SQL itself and unless you see very long query times, I wouldn't worry too much about them. But, as you said, find out first what generates them and from there you might see what optimization you can achieve, without breaking anything.

WEBmods

  • Hero Member
  • *****
  • Posts: 937
  • github.com/webmods-croatia/love-osclass/ | patrick
Re: Continuous locale query?
« Reply #2 on: April 25, 2019, 06:14:09 pm »
The thing is that I (actually my friend) get "MySQL server has gone away" errors and oc-admin is very slow. I checked queries.log and I saw that 2 queries repeating so I thought they are the reason.

I will try to find where are they called.

Thanks, regards.

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Continuous locale query?
« Reply #3 on: April 25, 2019, 08:56:26 pm »
t_locale is small, and since the data rarely changes, it should be really fast. 2nd query seems standard, 1st one is something custom probably. Each requests populates languages for various reasons, so 1/page/req is normal.

Can be many things, cron, plugin, or sometimes some users report this.

WEBmods

  • Hero Member
  • *****
  • Posts: 937
  • github.com/webmods-croatia/love-osclass/ | patrick
Re: Continuous locale query?
« Reply #4 on: April 25, 2019, 10:02:42 pm »
I think https://github.com/osclass/Osclass/issues/2297 did it. I told the friend to do more tests, but from what I've seen oc-admin is much quicker currently.

Thanks a lot. :) Regards.