Comments - Generated (Virtual and Persistent/Stored) Columns

6 years, 4 months ago David Choy
This comment has the status of 'removed' and can only be seen by you.

I have this table with a Json varchar column. Created virtual columns - virtual_grade_date from Json column. An index is built on virtual_grade_date, but it's not using this index.

Does Mariadb support virtual column indexes?

Thanks

CREATE TABLE `restaurant_inbox` ( `id` int(11) NOT NULL AUTO_INCREMENT, `file_name` varchar(400) NOT NULL, `rest_desc_json` varchar(5000) DEFAULT NULL, `date_created` datetime DEFAULT NULL, `date_modified` datetime DEFAULT NULL, `virtual_grade_date` datetime GENERATED ALWAYS AS (json_value(`rest_desc_json`,'$.inspection_date')) VIRTUAL, PRIMARY KEY (`id`), KEY `idx_restaurant_inbox_virtual_grade_date` (`virtual_inspection_date`), CONSTRAINT `CONSTRAINT_1` CHECK (`rest_desc_json` is null or json_valid(`rest_desc_json`)) ) ENGINE=InnoDB AUTO_INCREMENT=737196 DEFAULT CHARSET=latin1 |

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.