I have a table with a lot of records, and I want to restrict the data access to the last 3 years only, but I still want to keep the data there.
I saw a solution where is it possible to create an indexed view that restrict this data using a date filter, and this view becomes the main entrypoint to query the records, for example:
- I have a user_log table with millions of records
- I rename this user_log to user_log_history
- I create a view named user_log that filters the user_log_history table from the last 3 years.
I saw that some databases allow you to insert/update/delete through views if you follow a set of rules, which looks ok in my case.
So my question is: are there any performance downside on doing this? I'm using MySQL by the way.