Our database is loaded by full-text search requests. The problem was that MySQL server CPU usage was constantly about 100% with close to 0% of Memory usage. research brought me to the article Mysql full text search cause high usage CPU Among answers I found an interesting tool mysqltuner.pl Get the script and run $… Continue reading MySQL database optimisation
Tag: mysql
Java batch UPDATE/INSERT database
I was looking for some solution which will allow me to make more efficient update old and insert new item into MySQL database. 1. My story I have some data, which should be imported from a side datasource into my database. So, there is no possibility to match ids of outer data and local. Also… Continue reading Java batch UPDATE/INSERT database
Woocommerce & Polylang: common comments under product in different languages
I developed a WordPress multilingual site with shop, based on Woocommerce plugin. The task was to make all comments appear under all languages’ versions of a product. Tried a lot of possible solutions and finally came to bare mysql request. File woocommerce/single-product-reviews.php contains the line: wp_list_comments( array( ‘callback’ => ‘woocommerce_comments’, ‘avatar_size’ => 75 ) );… Continue reading Woocommerce & Polylang: common comments under product in different languages
WordPress DB migration from one domain to another
Usually I develop WordPress powered sites on my server and then migrate all to production one. Every time I have the same problem – name of old server is saved in DataBase various tables. It is possible to simplify the process. 1. execute domain name replacement in General settings update wp_options set `option_value` = replace(`option_value`,… Continue reading WordPress DB migration from one domain to another
WordPress e-commerce get list of product’s images
I wanted to customize e-commerce product default view. One of the aspect was to list all the gallery images on the page. See the following PHP code to get this information from DataBase.