How to avoid full table scans in MySql

For small data tables, the use of Full Table Scans has a negligible effect on performance. But with a table with a large amount of data, you can apply the following ways to avoid Full Table Scans:
– Use ANALYSIZE TABLE tbl_name to update but distribute the primary key (Key) to the scan table.
– Using ForceIndex for the scan table:
SELECT *FROM t1, t2 FORCE INDEX (index_for_column) WHERE t1.col_name=t2.col_name;

Bài viết liên quan