I am running a cron task that makes a lot of requests on the server MySQL. The big problem is that the server is very slow sometimes.
MySQL
I have a relatively large query with four tables left between them and 4 smaller queries with natural jointhat also attack the first table. After you select these queries, I process the results and group them using PHP.
natural join
PHP
What I'm planning is to somehow mix these 5 queries into one big query, and then let me PHPmake a few quick ones sort()when I need it.
sort()
I am also told that MySQLqueries are faster than PHPin terms of filtering and sorting, but I'm quite worried about this when I talk about the presence of 7 or 8 left joins. Some additional information about these requests (which I cannot copy due to company policy):
GROUP BY
So, due to these problems, and perhaps as a rule of thumb:
, PHP PHP?
, , . MySQL, . php , ( , , ), php .
, , , . , , . script, , , , . , , , , 0,2 0,002 .
. levenshtein ( , , 2 ). mysql, , . php levenshtein , , php levenshtein .
, . , 4 , 1 . , (, , ), . , , , , php ( usort ).
, . , php script SQL-, , SQL-, .
SQL . , PHP , , SQL.
Source: https://habr.com/ru/post/1533875/More articles:OnClickListener Π² Π΄ΠΈΠ½Π°ΠΌΠΈΡΠ΅ΡΠΊΠΎΠΌ ΡΠ°ΡΠΏΠΎΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ ΡΠ°Π±Π»ΠΈΡ - androidHow to get Haeckel code after desugaring arrow syntax? - haskellProblem with telephone connection when adding a platform - iosHXT: Can input change using arrow syntax? - xmlhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1533874/aspnet-identity-check-for-multiple-roles-to-get-access&usg=ALkJrhhBqYXQSs482_KMGl4dZwmSMLon6AIs factoring an arrow from an arrow a sign of actual transformation? - haskellΠΠΎΠΌΠΏΠ»Π΅ΠΊΡΠ½ΡΠΉ SQL-Π·Π°ΠΏΡΠΎΡ - ΡΡΠΌΠΌΠ° ΠΏΠΎΠ»Ρ Π² ΠΎΠ±ΡΠ΅Π΄ΠΈΠ½Π΅Π½Π½ΠΎΠΉ ΡΠ°Π±Π»ΠΈΡΠ΅ - sqlNode.js HTTP GET Request Content Type - httpDownload large pdf file with jsoup - java.NET MVC and Angular with ui-router - angularjsAll Articles