zoukankan      html  css  js  c++  java
  • [请教]关于超大数据量网站的数据搜索和分页的实现方法

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

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

    请各位大师指点一下我,超级谢谢
  • 相关阅读:
    SendMessage 和 SendMessageTimeout 可能存在异常(除超时)
    类型强制转换符 与 + 符的优先级
    茵茵的第一课
    C小加 之 随机数
    16进制的简单运算
    交换输出
    计算球体积
    a letter and a number
    A problem is easy
    Coin Test
  • 原文地址:https://www.cnblogs.com/bankey/p/949605.html
Copyright © 2011-2022 走看看