i read some advice about table indexing, and i fount out that indexes should be introduced later when your sql queries are running slow..
my problem is I index almost all my columns in one table. this table is tied to other table, for example the users table column country is tied to the country table
user table country table
id id
countryId name
I added an index in the countryId column, so that I can link it to the country table's id because i can't create a foreign key constraints when I don't have an index on the column.
Basically i have many columns that are link to other table just to add constraints to my column.
for example, the country table is not more than 100, so if someone just accidentally inserted a value of 101, mysql won't accept that data because the country table only have 1-100..
So how can i avoid adding indexes and still have the function of table data constraints?