Jump to content
  • 0

MYSQL [WARNING] cache_warning_count | mysql_unprocessed queries


ScriptarFals

Question

[12:24:51 08/17/18] [DEBUG] mysql_format - connection: 1, len: 1024, format: "UPDATE `users` SET `Seconds`='%d' WHERE `name`='%s'"
[12:24:51 08/17/18] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `users` SET `Seconds`='60' WHERE `name`='ScriptarFals'", callback: "(null)", format: "(null)"
[12:24:51 08/17/18] [DEBUG] mysql_format - connection: 1, len: 1024, format: "UPDATE `users` SET `Minutes`='%d' WHERE `name`='%s'"
[12:24:51 08/17/18] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[12:24:51 08/17/18] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `users` SET `Minutes`='58' WHERE `name`='ScriptarFals'", callback: "(null)", format: "(null)"
[12:24:51 08/17/18] [DEBUG] cache_warning_count - connection: 1
[12:24:51 08/17/18] [WARNING] cache_warning_count - no active cache
[12:24:51 08/17/18] [DEBUG] mysql_unprocessed_queries - connection: 1

Am intr-un timer de o secunda update-ul ce tine de 'Seconds' si 'Minutes', anume daca sterg update-ul unprocessed_quearies scade la 1 (normal am 3 cu oricati jucatori online). De ce sunt 'unprocessed_quaries' ? Daca apelez update-ul din comanda ca debug este totul ok, insa daca-l pun in timer il vede ca [WARNING].

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

cache_warning_count il poti chema doar intr-un callback al functiei mysql_t/pquery sau alaturi de mysql_query

Exemplu aici: http://wiki.sa-mp.com/wiki/MySQL#cache_warning_count

De acea iti spune ca e inactive cache, pentru ca nu are de unde sa extraga cache 

Cat despre mysql_unprocessed_queries iti intoarce cate querry-uri asteapta sa fie executate de catre mysql, iar faptul ca executi aia intr-un timer si ai ,ulti playeri on asta poate umple acel pool de querry

http://wiki.sa-mp.com/wiki/MySQL#mysql_unprocessed_queries

Un sfat ar fi sa nu mai folosesti '%d' sau '%f' sau '%i' pentru astea sunt numere iar nuemrele nu au nevoie sa fie vazute ca si stringuri(e posibil ca acest lucru sa incetineasca procesarea querry-urilor dat fiind faptul ca serverul mysql va trebui sa transforme acel string in numar ca sa il poata salva corect)

De asemeana, folosind WHERE name = '%s' in loc WHERE id = %d , care id este primary key in baza de date poate sa incetineasca cautarea playerului respectiv. Intodeauna un numar care este si index al unui tabel din baza de date va fi gasit mult mai rapid decat cautand un string. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.