Quoting Physical Database Design [1]:
"index statistics can be sufficiently estimated for the purposes of
physical design advisors from relatively straightforward calculations
based on the table and columns statistics of the underlying table that
the virtual index will be based on."
There are already tools like this for other RDBMS: Microsoft SQL Server
Database Tuning Advisor, Oracle Access Advisor and IBM DB2 Design
Advisor. I just want to create a tool that does the same thing for MySQL.
Furthermore I intend to analyze all the SQL queries, including SELECTs,
INSERTs, UPDATEs and DELETEs. Thus I want to find some index
configuration that is good enough for the entire workload. I do know
that workload can vary over time and the optimizations become outdated,
but this is an academic research and I am assuming a constant workload.
Adapt to dynamic workload changes is future work.
I plan to use some statistics such as how many times each query is
executedto make queries that run most often to perform better. So, if
there are more INSERTs and UPDATEs than SELECTs in a given table, I
intend to recommend less indexes for this table, and even suggest to
drop some existing indexes if needed.
[1] LIGHTSTONE S., TEOREY T., NADEAU T. Physical Database Design: The
Database Professional’s Guide to Exploiting Indexes, Views, Storage, and
More. San Francisco, CA, USA: Morgan Kaufmann Publishers Inc., 2007.
ISBN 9780080552316.