Big data consists of many documents that are stored in the JSON format, so it is necessary to have proper indexing on JSON data. There is no direct way to define an index on JSON data. We can always create columns from the JSON data and then leverage the generated columns to support indexes.
Let's first understand what generated columns are in MySQL.
Generated columns generally do not have actual information, but they store the information gathered from other columns of the table using some expressions or calculations.
Generated columns can be divided into two types: virtual generated columns and stored generated columns.
Columns defined as virtual generated columns do not actually store the value but they are calculated on the fly. If there is no column type defined for generated columns, it would use virtual columns by default. InnoDB supports secondary indexes on virtually generated columns. As the value of virtual columns are calculated...