惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
B
Blog
博客园 - Franky
I
InfoQ
A
About on SuperTechFans
博客园_首页
L
LangChain Blog
量子位
腾讯CDC
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
美团技术团队
V
V2EX
Apple Machine Learning Research
Apple Machine Learning Research
雷峰网
雷峰网
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
G
Google Developers Blog
Last Week in AI
Last Week in AI

博客园 - Bankey

word删除水平线(分割线)的方法(原创) hao123的成功能否复制?谈我对2345导航的看法和推广 如何解决安装DreamWeaver8 时候提示“无法将数值写入键/SOFTWARE/classes/.shtml” 手机如何设置静态IP [请教]SQL2005复制功能同步Oracle数据后,索引丢失? 短信猫发送长短信[求教] 离开伤心地 脑肿瘤的饮食治疗 Windows 2003 下IIS6.0出现Http错误403.1的解决 关于Web Deployment Projects Visual Studio 2005 使用RoleProvider的一个疑问 ComponentArt 动态加载的TreeView, 添加一个新节点后,新节点为什么在页面中不会显示? - Bankey 看《我的2007:迷失的2007 》有感 使用母板页后javascript getelementbyid出错的解决方案 AJAX写的Tree在FireFox中不能显示 - Bankey - 博客园 AJAX 树 小图片狂下载的问题 SQL Server 2005中导入.csv文件 svchost.exe[900]中发生未处理的win32异常 access中的insert错误
[请教]关于超大数据量网站的数据搜索和分页的实现方法
Bankey · 2007-11-05 · via 博客园 - Bankey

请教像阿里巴巴这样的数据量过百万的网站,其数据搜索和分页是如何实现的?

我个人是用全文索引做的,把物品名和物品简介放在一起,检索这个字段。
分页是用存储过程做的,

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

请各位大师指点一下我,超级谢谢