Querying for Data in MySQL is Slow


1 min read

Trying to query the MySQL database is slow (millions of records in table)

Example query:

SELECT * FROM my_table WHERE code='X87L9D82NB';

Just add an index to the column that is frequently used to query for data

Query to add index:

CREATE INDEX index_name ON table_name (column_name);