首页 > 解决方案 > 提高 30 个表的搜索速度

问题描述

我想对 30 个这样查询的表进行搜索:

select count(*)
from view1
where field1 like N'%searchKeyword%' or field1 like N'%searchKeyword%' or field1 like N'%searchKeyword%' or field1 like N'%searchKeyword%' or ...
union all
select count(*)
from view2
where field11 like N'%searchKeyword%' or field12 like N'%searchKeyword%' or field13 like N'%searchKeyword%' or field14 like N'%searchKeyword%' or ...
union all
select count(*)
from view3
where field21 like N'%searchKeyword%' or field22 like N'%searchKeyword%' or field23 like N'%searchKeyword%' or field24 like N'%searchKeyword%' or ...
union all
.
.
.

在这种方法中,由于表中的字段数量较多,当数据数量增加时,pitch的速度会降低

你有什么报价

标签: sql-serverperformance

解决方案


推荐阅读