-
The curious case of updating a value
The issue, described below is very strange when you find it, because it works only in MySql. In MySql the update keeps track of the order of the parameters updated. So while for any known DBMS when you update a field computed considering another one (i.e. set A = 10, B = A…) the value of A and B are calculated starting from the original value for each update in MySql as soon as you update a field, this new value will be used instead of the original. Besides this you can use the order clause to specify HOW update the values. This cose works on MySql and on SQL…
-
Massive Spam Delete on WordPress
I found a lot (A LOT) of spam comments on WordPress recently and decided to get rid of them easily. Solution 1: from the WP backend This solution is not reasonable because at the moment any bulk operation on the Db from the application generally cause a timeout. Akismet itself (the plugin which choose what is spam and what is not) has no such feature and installing SOMETHING to REMOVE other stuff is quite crazy imho. So I decided to create a procedure on Database side, checking also the MySQL performance against such an operation. First cold attempt: find what is Spam for Akistmet: Table wp_commentmeta Filter: meta_key = ‘akismet_result’ and meta_value…
-
Lentezza in PhpMyAdmin
PhpMyAdmin di default attiva una opzione $cfg[‘MaxExactCountViews’] nella lista di quelle disponibili. Cosa viene attivato di bello? Sostanzialmente quando viene caricata la lista di tabelle e viste PMA esegue in background un count dei record di tutte le viste e lo presenta nella colonna Righe/Rows. Naturalmente se avete una vista “pesante” tutto ciò rallenta persino l’accesso alla applicazione stessa. Grazie a Future500