| I am not familiar with MySQL. Is there a field for each column of the table that lets you specify whether that column is indexed? A search on a non-indexed column, would be pretty slow.
Also, if that company column is indexed (it needs to be), then the database spends all that time indexing your string. Maio's solution would help a lot. You should almost always use string tables (two columns: primary key and the string) for repeating data.
I don't know how arbitrarily you came up with that 50,000 number for the data. It implies that they repeat an average of 30-35 times over 1.8m rows. If this is the case then you should really turn this into a relational database and create a 3rd table called 'CompanyData'. This table would have a foreign key for the 'Company' and 'adata' tables (so two columns total).
Unless a new company or adata item is created, all updates will be to this CompanyData table. Since it is just 2 integers, it should be fairly fast.
__________________
If God didn't want us to eat animals, why did He make them out of meat?
|