视图上无法创建索引

来源:互联网 发布:网络测试工程师面试 编辑:程序博客网 时间:2024/06/05 09:29
mysql> create view v_test as select * from test;Query OK, 0 rows affected (0.15 sec)mysql> desc v_test;+-------+----------+------+-----+---------+-------+| Field | Type     | Null | Key | Default | Extra |+-------+----------+------+-----+---------+-------+| id    | int(11)  | YES  |     | NULL    |       || name  | char(10) | YES  |     | NULL    |       |+-------+----------+------+-----+---------+-------+2 rows in set (0.07 sec)mysql> create index v_test_idx1 on v_test(id);ERROR 1347 (HY000): 'zjzc.v_test' is not BASE TABLE

0 0