查询一:
select a.*
from
(
select
row_number() over (order by id desc) as srno
id,name as myname,*
from table
where name like 'search%' or column1 like 'search%' or column2 like 'search%'
or column3 like 'search%'
or column4 like 'search%'
or column5 like 'search%'
) a
where srno>=1 and srno<=50
我的桌子上有 100 000 行。此查询执行需要 48 秒。我已经应用了备用查询:
查询 2:
select top 50
row_number() over (order by id desc) as srno
id,name as myname,*
from table
where name like 'search%' or column1 like 'search%' or column2 like 'search%'
or column3 like 'search%'
or column4 like 'search%'
or column5 like 'search%'
查询 2 执行大约需要 0 秒 有索引 一切就绪 在两种情况下都应用
有什么方法可以在 0 秒内执行查询 1 吗?
我想实时执行速度。