WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • General Community »
  • Global WebsiteBaker 2.8.x discussion »
  • DB - Optimierung
  • Print
Pages: [1]   Go Down

Author Topic: DB - Optimierung  (Read 15401 times)

Offline Psp

  • Posts: 94
DB - Optimierung
« on: August 24, 2016, 12:05:00 PM »
Hallo,
weil der Provider meckert über hohe Belastung der MySql Datenbank, mussten wir mal in logs und Variablen gucken. m.E. sind alle Slow-Logs von WB und ich vermute da könnte man einiges optimieren

Code: [Select]
Mysql Status Variable (aus phpMyadmin->Status)
Select full join 192 Anzahl der Joins ohne Schlüssel. Wenn dieser Wert nicht 0 ist sollten die Indizes der Tabellen sorgfältig überprüft werden.
Select full range join 111 Anzahl der Joins, bei denen eine Bereichssuche auf die Referenztabelle statt fand.
Select range               1.6 k Anzahl der Joins, bei denen Bereiche auf die erste Tabelle benutzt wurden. (Es ist normalerweise unkritisch, wenn dieser Wert hoch ist.)
Select range check        168 Anzahl der Joins ohne Schlüssel, bei denen nach jeder Zeile auf Schlüsselbenutzung geprüft wurde. (Wenn dieser Wert nicht 0 ist sollten die Indizes der Tabellen sorgfältig überprüft werden.)
Select scan                34.6 k Anzahl der Joins, bei denen die erste Tabelle gescannt wurde.

im dem Slow-query-Log ist mir dieser Join aufgefallen:
SELECT `p`.`page_id`, `link` FROM `wb_pages` `p` INNER JOIN `wb_sections` USING(`page_id`) WHERE `parent`=0 AND `visibility`='public' AND ((1471874381>=`publ_start` OR `publ_start`=0) AND (1471874381<=`publ_end` OR `publ_end`=0) ) AND `language`='DE' ORDER BY `p`.`position` ASC;
# Time: 160822 15:59:42
# User@Host: root[root] @ localhost []
# Query_time: 1.963119  Lock_time: 0.000116 Rows_sent: 2  Rows_examined: 905
Ich denke mal, da ist noch Luft nach oben - was sagen die Experten?
Gruß
psp
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: DB - Optimierung
« Reply #1 on: August 24, 2016, 12:21:14 PM »
First of all, note that the timestamp, user and querytime are logged above the query.
The long (almost 2 seconds) query was:

Code: [Select]
# Time: 160822 15:59:42
# User@Host: root[root] @ localhost []
# Query_time: 1.963119  Lock_time: 0.000116 Rows_sent: 2  Rows_examined: 905
SET timestamp=1471874382;
SELECT ENGINE,SUM(DATA_LENGTH+INDEX_LENGTH),COUNT(ENGINE),SUM(DATA_LENGTH),SUM(INDEX_LENGTH) FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema', 'performance_schema', 'mysql') AND ENGINE IS NOT NULL GROUP BY ENGINE ORDER BY ENGINE ASC;
executed by the root user (your host)
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

Offline Psp

  • Posts: 94
Re: DB - Optimierung
« Reply #2 on: August 24, 2016, 01:13:12 PM »
Hi Ruud,
I just noticed my error. Yes the very slow query was
Code: [Select]
# Time: 160822 15:59:42
# User@Host: root[root] @ localhost []
# Query_time: 1.963119  Lock_time: 0.000116 Rows_sent: 2  Rows_examined: 905
SET timestamp=1471874382;
SELECT ENGINE,SUM(DATA_LENGTH+INDEX_LENGTH),COUNT(ENGINE),SUM(DATA_LENGTH),SUM(INDEX_LENGTH) FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema', 'performance_schema', 'mysql') AND ENGINE IS NOT NULL GROUP BY ENGINE ORDER BY ENGINE ASC;
Thanx for noticing!
psp
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • General Community »
  • Global WebsiteBaker 2.8.x discussion »
  • DB - Optimierung
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2