I have a MySQL table with 20 million rows. I am using the average function and this is taking too much time.
I want to break this big table up into multiple smaller tables. I want to boost speed and user experience by allowing the user to search only part of the data.
If possible, I would like to do this using a single SQL statement. The big table is in the following format:
Column Column Column Sector
data data data Retail
data data data Utility
data data data Retail
data data data Insurance
data data data Retail
data data data Agriculture
data data data Agriculture
data data data Retail
This big table would be broken up according to the value in the Sector column. There would be a Retail table, an Agriculture table and so on.