请教像阿里巴巴这样的数据量过百万的网站,其数据搜索和分页是如何实现的?
我个人是用全文索引做的,把物品名和物品简介放在一起,检索这个字段。
分页是用存储过程做的,
CREATE PROCEDURE GetSearchEnterprise
(
@strWhere varchar(3000),
@PageSize int,
@PageIndex int
)
AS
declare @strSQL varchar(8000)
if @PageIndex=1
begin
set @strSQL='select top '+str(@PageSize)+' * from t_company where '+@strWhere+'order by companyid desc'
end
else
begin
set @strSQL='select top '+str(@PageSize)+' * from t_company where companyid<(select min(tmp_t_company.companyid) from (select top '+str((@PageIndex-1)*@PageSize)+' companyid from t_company where '+@strWhere+' order by companyid desc) as tmp_t_company ) and '+@strWhere+' order by companyid desc'
end
exec(@strSQL)
--print(@strSQL)
GO
请各位大师指点一下我,超级谢谢
我个人是用全文索引做的,把物品名和物品简介放在一起,检索这个字段。
分页是用存储过程做的,



















请各位大师指点一下我,超级谢谢
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步