Hello, we are running MySQL database and php application on 2 different servers. (from digitalocean).
What we tried?
-
we added index on stock_status which can be only 3 values (out_of_stock, available_in_stock, available_to_order). It improved the response time.
-
We also deployed this fix to live server and found out, that the result is not the same as in testing. (On local with exported DB average response time is 600ms, on live server is around 2s)
We dug little bit further and found, that if we order by 2 columns, then the response time increases. Is there any solution how to increase speed? We know that there is somethinf like multicolumn index, but we do not know, if this would solve our problem - we do not have this much expertise in MySQL.
Im sending to you the query which takes the most time.
Note: catalog column is a json column.
Thank you for any help!