sql-server - 提高 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的速度会降低
你有什么报价
解决方案
推荐阅读
- visual-studio-code - VS 代码“textSeparator.foreground”设置
- javascript - 节点,Express.js。无法获得通过 Chai 测试的 POST 请求
- python - 在带有 sqlalchemy 的嵌套 sqlite3 查询中使用 ROW_NUMBER() 会导致 sqlite3.OperationalError: near "(": 语法错误
- python - Scrapy、Splash 和 Connection 被对方拒绝:10061
- sockets - 套接字端口是否与常规端口相同
- python-3.x - Python使用List Comprehension替换字符串列表中的空字符串
- arrays - Mongodb find() 需要 1 秒
- javascript - 使用 HapiJS 的实验室上下文帮助程序会导致错误
- php - 访问页面时的 HTML 505 (PHP)
- c - 使用加法的阶乘