Jsp页面,结果集分页和sql(top)分页的数据库性能对比分析
来源:互联网 发布:em算法实战 编辑:程序博客网 时间:2024/04/28 10:51
jsp页面两种分页模式:
第一种: 结果集分页,主要代码见下面:
第二种: sql语句分页
sql=“selec top 20 id,name from table where id not in(select top 2000 id from table )”;
对这两种分页做了测试,在400万条数据的情况下,两者性能几乎一样,相差不大。大概速度在30秒左右。
测试数据(每页20条):
sql分页
页数 时间 用时
2--test2 starttime=Mon Oct 26 16:24:35 CST 2009
2--test2 endtime=Mon Oct 26 16:25:09 CST 2009 34
200--test2 starttime=Mon Oct 26 16:25:48 CST 2009
200--test2 endtime=Mon Oct 26 16:26:21 CST 2009 33
20000--test2 starttime=Mon Oct 26 16:27:04 CST 2009
20000--test2 endtime=Mon Oct 26 16:27:39 CST 2009 35
210000--test2 starttime=Mon Oct 26 16:28:22 CST 2009
210000--test2 endtime=Mon Oct 26 16:29:58 CST 2009 36
100000--test2 starttime=Mon Oct 26 16:30:30 CST 2009
100000--test2 endtime= Mon Oct 26 16:31:10 CST 2009 40
---- 结果集分页
2--11start time Mon Oct 26 16:33:37 CST 2009
2---55end time Mon Oct 26 16:34:12 CST 2009 35
200--11start time Mon Oct 26 16:34:59 CST 2009
200---55end time Mon Oct 26 16:35:32 CST 2009 33
20000--11start time Mon Oct 26 16:36:26 CST 2009
20000---55end time Mon Oct 26 16:36:59 CST 2009 33
210000--11start time Mon Oct 26 16:38:00 CST 2009
210000---55end time Mon Oct 26 16:38:33 CST 2009 33
100000--11start time Mon Oct 26 16:39:10 CST 2009
100000---55end time Mon Oct 26 16:39:43 CST 2009 33
第一种: 结果集分页,主要代码见下面:
Java代码
第二种: sql语句分页
sql=“selec top 20 id,name from table where id not in(select top 2000 id from table )”;
对这两种分页做了测试,在400万条数据的情况下,两者性能几乎一样,相差不大。大概速度在30秒左右。
测试数据(每页20条):
sql分页
页数 时间 用时
2--test2 starttime=Mon Oct 26 16:24:35 CST 2009
2--test2 endtime=Mon Oct 26 16:25:09 CST 2009 34
200--test2 starttime=Mon Oct 26 16:25:48 CST 2009
200--test2 endtime=Mon Oct 26 16:26:21 CST 2009 33
20000--test2 starttime=Mon Oct 26 16:27:04 CST 2009
20000--test2 endtime=Mon Oct 26 16:27:39 CST 2009 35
210000--test2 starttime=Mon Oct 26 16:28:22 CST 2009
210000--test2 endtime=Mon Oct 26 16:29:58 CST 2009 36
100000--test2 starttime=Mon Oct 26 16:30:30 CST 2009
100000--test2 endtime= Mon Oct 26 16:31:10 CST 2009 40
---- 结果集分页
2--11start time Mon Oct 26 16:33:37 CST 2009
2---55end time Mon Oct 26 16:34:12 CST 2009 35
200--11start time Mon Oct 26 16:34:59 CST 2009
200---55end time Mon Oct 26 16:35:32 CST 2009 33
20000--11start time Mon Oct 26 16:36:26 CST 2009
20000---55end time Mon Oct 26 16:36:59 CST 2009 33
210000--11start time Mon Oct 26 16:38:00 CST 2009
210000---55end time Mon Oct 26 16:38:33 CST 2009 33
100000--11start time Mon Oct 26 16:39:10 CST 2009
100000---55end time Mon Oct 26 16:39:43 CST 2009 33
- Jsp页面,结果集分页和sql(top)分页的数据库性能对比分析
- 使用结果集(ResultSet.absolute((2000)) )和 sql(top)分页的性能对比
- 数据库分页的两种方法对比(row_number()over() 和 top的对比)
- 各数据库分页SQL对比
- 数据库结果集分页
- JSP分页显示 - JSP页面和数据库结合
- 【转载】Sql Server2005不同分页存储过程的性能对比
- jsp页面的分页实现
- jsp查询结果分页
- 分页类和页面,(MYSQL,其他数据库需更改SQL)
- 实验二:分页显示数据库信息(jsp页面直接分页)
- jsp+sql2000 使用top分页
- .net 2007数据库性能分析(分页)
- Mabits的PageHelper分页插件的使用和Jsp分页页面展示(带源码)
- jsp实现分页和页面跳转功能
- JSP分页,查询结果分页显示
- 使用rownum对oracle结果集快速分页的sql
- 一个分页排序SQL查询结果集不确定的案例
- ubuntu9.10 ibus 从源码包安装五笔
- 对Word进行各种操作
- java中类的加载机制
- 学习笔记 从零开始学单片机(1) 建立实验环境
- Velocity在eclipse和Editplus下的开发插件
- Jsp页面,结果集分页和sql(top)分页的数据库性能对比分析
- JS时间显示
- php的几个不太常用的函数
- ACTIVE制作数字签名
- HTTP协议详解
- MyEclipse编辑Jsp死机问题
- YUI学习总结
- cfmail标签发邮件
- java.lang.NegativeArraySizeException