我有10个表具有相同的列。我按年度分别制作了数据,如2011,2012 .. 2020
。
我制作了一个视图,用于使用union all合并所有表数据。
create view as a combine
select * from table_2011
union all
select * from table_2012
..
union all
select * from table_2020;
现在,当我运行一些以9分钟为单位进行分组的查询以返回数据时。
select name, count(name) from combine group by name;
谁能帮助我提高观看速度?我已经为所有表和列都提供了索引。
答案 0 :(得分:0)
在视图的名称列中添加索引