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

推荐订阅源

W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
F
Full Disclosure
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threatpost
I
Intezer
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
小众软件
小众软件
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
N
News | PayPal Newsroom
MyScale Blog
MyScale Blog
AI
AI
Vercel News
Vercel News
Spread Privacy
Spread Privacy
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
U
Unit 42
L
LangChain Blog
Recent Announcements
Recent Announcements

博客园 - Blackie

碰到shiro反序列化漏洞,大家都是怎么解决的 由于 ASP.NET 进程标识对全局程序集缓存没有读权限,因此未能执行请求。错误: 0x80131902 vs 2005 thread 无法调试 windows 2003 不同网段 无法 文件共享 VSS设置 添加COM类型库ACTIVEX接口 - Blackie - 博客园 windows media play javascript 全屏 单击事件 今天把HP6520S笔记本给拆解了 如何引用 System.Runtime.Serialization.Json; FLASH CS4 制作渐变 动画 有补间动画 传统补间 json2string json格式到string的转换,调试有时候可以用到 asp.net ajax 客户端框架未能加载 sys 未定义 - Blackie WCF 返回json的时间格式的转换 - Blackie - 博客园 jquery 跨域调用wcf 返回json 碰到的一些问题 WCF IIS 用户名消息安全 可能碰到的问题 - Blackie 今天发布的一个程序一直提示Microsoft.mshtml的强名称验证失败 在ASP.NET 中调用RSACryptoServiceProvider失败,提示未找到文件 显示listview的行号 - Blackie - 博客园 AxWebBrowser,WebBrowser remoting作成windows服务后一直无法读取配置文件,可能的原因之一。
分页SQL语句的性能比较
Blackie · 2008-07-01 · via 博客园 - Blackie

数据量暂时在10来万,排序字段是几个索引里面的一个索引的二级索引
第一方案是比较传统的,
第二方案用了表变量,有说数据量大的时候应该用临时表,不知道这个量要多少。
感觉。。

DECLARE @pagesize int
DECLARE @pageindex int
DECLARE @docount bit
DECLARE @this_id INTSET @this_id = 114
SET @docount = 3
SET @pagesize = 10
set @pageindex = 11983--select count(*) from wn_pARTSnEWS where NEWSCLASSid=@this_id
 -- where NEWSCLASSid=@this_id

--方案一
BEGIN 
 
select TOP 10 * from wn_partsNews where partsNewsId not in (SELECT TOP 119830 PARTSNEWSID FROM WN_PARTSNEWS ORDER BY ADDTIME DESCORDER BY ADDTIME DESC
END
--方案二
begin
 
declare @indextable table(id int identity(1,1),nid int)
 
declare @PageLowerBound int
 
declare @PageUpperBound intset @PageLowerBound=(@pageindex-1)*@pagesize --开始
 set @PageUpperBound=@PageLowerBound+@pagesize --结束

 
set rowcount @PageUpperBoundinsert into @indextable(nid) select PARTSNEWSid from WN_PartsNews order by ADDTIME descselect a.* from WN_PartsNews a,@indextable t where a.PARTSNEWSID=t.nid and t.id>@PageLowerBound and t.id<=@PageUpperBound order by t.idend
GO