I have osCommerce installed with a website that has 140k products and product_description table size is about 300MB. Page load tooks 15 second to 20 second, I cut the table to 100MB for testing purpose and now it seem it is working as normal.
So I decided to use mySQL partition and made
PARTITION BY KEY()
PARTITIONS 10;
After this change I tested it but no change.
Now I decided to split database table into 3 or more with names like below
product_description1
product_description2
product_description3
...
...
Am I doing wrong? Why mySQL partition didn’t affect the performance or speed? Please suggestions.
2
Answers
Don’t mechanically apply partitioning if you don’t have a clue that will help. Do the usual stuff first: index tuning.
The gains you get from partitioning entirely depend on the query patterns. I suspect your queries do not benefit from it. But they surely would benefit from the right indexes.
Unless you are very intentional and clever about your partitioning schema, you will hurt performance, rather than help it, by introducing partitions.
The first thing you need to do when trying to improve performance, is analyze your queries. By doing this, you will probably find that you can get the performance gains you need with some index tweaks, and/or some server configuration tweaks.
300mb is not a very large table. But depending on your queries, it may be slurping large amounts of your table into memory. If your MySQL memory parameters are not properly tuned, you may be swapping to disk prematurely, thus making your queries very slow.