This error occurs when the database needs to search on more than 1 million rows to meet
he requirements of your query.
This limitation does not concern the number of records in a table,but rather how many records
will be read to satisfy a query, so in a table without proper optimization mysql can make multiple
queries to fit the result of a query, addition of indexes, causes mysql to scan fewer records.
- To solve the error in question:
Optimize your query and also create index in your tables, thus increasing the performance of your database.