I am going through documentation of MySql Indexes Optimization.
I found a setting --max-seeks-for-key=1000.I checked the "server system variables" of MySQL here.
According to it
"By setting this to a low value (say, 100), you can force MySQL to prefer indexes instead of table scans"
.
What i understand from FULL TABLE SCAN is:
When a query needs to access most of the rows, reading sequentially is faster than working through an index. Sequential reads minimize disk seeks, even if not all the rows are needed for the query.
Therefore if MySQL is doing Full Table Scan which minimize disk seeks why would one use --max-seeks-for-key=1000 to prefer index scan which may increase disk seeks.
Here at the documentation 8.3.1.20 How to Avoid Full Table Scans its mentioned as a step to avoid full-scan: Start mysqld with the --max-seeks-for-key=1000
So I am curious to know if there is any practical and meaningful use of --max-seeks-for-key.
Yes, I know it's an awful query
. Can you explain? – Stringency