I have a table which contains information about time, So the table has columns like year, month, day, hour and so on.
Table has data across years and quite big so i decided to make partition on this table and started learning about Mysql partitioning but caught up by few questions.
I will really appreciate, if someone can help me understand how partition and indexes will work together.
- If i create partition over year column and also have an index on the same column, how partition and index will work together? How it will impact the performance over, if i had index on year column only and table has no partition?
Ex. Sql: Select month, day, hour ... from time_table where year = '2017';
- If table has partition over year column and query is filtering records over month column and month column is indexed. How index over month and partition over year will impact the select performance.
Ex Sql: Select year, month, day .... from time_table where month = '05';