首页 / MYSQL / 查询分页-----强势top
查询分页-----强势top
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了查询分页-----强势top,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2950字,纯文字阅读大概需要5分钟。
内容图文
![查询分页-----强势top](/upload/InfoBanner/zyjiaocheng/563/1f57fa2487c24f1598a0b1b05030008b.jpg)
查询分页:语句1性能提升10倍多,只是因为多了个top关键字,很不理解啊!!!! 1.查询时间1s内,r_object_id主键 select top 100 * from ( select all doc.r_object_id objid,doc.name,doc.number, doc.cuid, doc.r_creation_date, doc.security, doc.bordline,
查询分页:语句1性能提升10倍多,只是因为多了个top关键字,很不理解啊!!!!
1.查询时间1s内,r_object_id主键
select top 100 * from (
select all doc.r_object_id "objid",doc.name,doc.number, doc.cuid, doc.r_creation_date, doc.security, doc.bordline, doc.twicedline, doc.dline, doc.keynum, doc.creator_name,
doc.security_name, doc.dline_name, doc.pid, doc.modifier_name, doc.tblcount, doc.r_modify_date, doc.prjdefid, doc.voldefid, doc.tabledefid, doc.relation_id,
doc.r_object_type "r_object_type", doc.bcode "bcode", doc.copycount, doc.securityapply, doc.pgholtime, doc.done, doc.disciplineid, doc.disciplineid_name,
tabdef.fieldp2830b1886150468j, tabdef.fieldb7727l1886150454q, tabdef.fields5243t504621622q, tabdef.fieldt3385x504621623d, tabdef.fieldf3763y504621609s, tabdef.fieldk1536t504621614n,
tabdef.fieldr1297k504621621z, tabdef.fieldb5089j1350775945q, tabdef.fieldk5874q1350775954t, tabdef.fieldb2206h1350775945a, tabdef.fieldf4308a1350775949v, tabdef.recid,
CAST(ROW_NUMBER() OVER(ORDER BY doc.r_object_id asc ) as int) as dm_rnum
from ps_fld_doctree_document_sp doc
LEFT OUTER JOIN tabledef00054a9a80001e7d_sp tabdef ON (doc.r_object_id=tabdef.recid) where (doc.keynum like N'aaaaaaaaaaaaaaa%' and ((doc.isdel=0) or (doc.isdel=1)) )
and (doc.i_has_folder = 1 and doc.i_is_deleted = 0)
) dm_inline_view_1
where dm_rnum >= 101 AND dm_rnum <= 200 order by 1 asc
2.查询时间10s内
select * from (
select all doc.r_object_id "objid",doc.name,doc.number, doc.cuid, doc.r_creation_date, doc.security, doc.bordline, doc.twicedline, doc.dline, doc.keynum, doc.creator_name,
doc.security_name, doc.dline_name, doc.pid, doc.modifier_name, doc.tblcount, doc.r_modify_date, doc.prjdefid, doc.voldefid, doc.tabledefid, doc.relation_id,
doc.r_object_type "r_object_type", doc.bcode "bcode", doc.copycount, doc.securityapply, doc.pgholtime, doc.done, doc.disciplineid, doc.disciplineid_name,
tabdef.fieldp2830b1886150468j, tabdef.fieldb7727l1886150454q, tabdef.fields5243t504621622q, tabdef.fieldt3385x504621623d, tabdef.fieldf3763y504621609s, tabdef.fieldk1536t504621614n,
tabdef.fieldr1297k504621621z, tabdef.fieldb5089j1350775945q, tabdef.fieldk5874q1350775954t, tabdef.fieldb2206h1350775945a, tabdef.fieldf4308a1350775949v, tabdef.recid,
CAST(ROW_NUMBER() OVER(ORDER BY doc.r_object_id asc ) as int) as dm_rnum
from ps_fld_doctree_document_sp doc
LEFT OUTER JOIN tabledef00054a9a80001e7d_sp tabdef ON (doc.r_object_id=tabdef.recid) where (doc.keynum like N'aaaaaaaaaaaaaaa%' and ((doc.isdel=0) or (doc.isdel=1)) )
and (doc.i_has_folder = 1 and doc.i_is_deleted = 0)
) dm_inline_view_1
where dm_rnum >= 101 AND dm_rnum <= 200 order by 1 asc
内容总结
以上是互联网集市为您收集整理的查询分页-----强势top全部内容,希望文章能够帮你解决查询分页-----强势top所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。