当前在线人数10865
首页 - 分类讨论区 - 电脑网络 - 窗口里的风景版 - 同主题阅读文章

此篇文章共收到打赏
0

  • 10
  • 20
  • 50
  • 100
您目前伪币余额:0
未名交友
[更多]
[更多]
DataReader vs. DataSet
[版面:窗口里的风景][首篇作者:LodossWar] , 2003年10月21日23:22:13 ,230次阅读,11次回复
来APP回复,赚取更多伪币 关注本站公众号:
[分页:1 ]
LodossWar
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 1 ]

发信人: LodossWar (sleepycat), 信区: DotNet
标  题: DataReader vs. DataSet
发信站: Unknown Space - 未名空间 (Tue Oct 21 23:22:13 2003) WWW-POST

My words on this:
dataset way is more scalable, especially for busy service(a lot of
connections). But datareader is faster if not that many requests.
hehe, dataset just "looks faster" for busy web serive.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/bd
adotnetarch031.asp

In all of the preceding tests, we saw that DataReader outperformed DataSet. As
mentioned earlier, the DataReader offers better performance because it avoids
the performance and memory overhead associated with the creation of the
DataSet.

The DataReader is a better choice for applications that require optimized
read-only and forward-only data access. The sooner you load the data off the
DataReader, close the DataReader, and close the database connection, the
better performance you get. Because the DataReader holds a database connection
that cannot be used for any other purpose while the application reads data, it
could limit scalability if the application holds the DataReader long enough
for contention to occur. The DataSet only needs to hold a connection while it
is being populated. Once it is filled, the connection may be closed and
returned to the pool. Delaying reading the data from the DataSet will not
cause contention to occur, as the connection might have been returned to the
pool already.



--
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 151.201.]

 
kongzi
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 2 ]

发信人: kongzi (鸡龟骨滚羹), 信区: DotNet
标  题: Re: DataReader vs. DataSet
发信站: Unknown Space - 未名空间 (Wed Oct 22 11:03:33 2003) WWW-POST

Personally I like dataset more than datareader.
As you said datareader holds the connection exclusivly.Though the connection
pooling is done by the framework in most of the cases.I still like to share
the connection in my program if possible and it's clearer.
【 在 LodossWar (sleepycat) 的大作中提到: 】
: My words on this:
: dataset way is more scalable, especially for busy service(a lot of
: connections). But datareader is faster if not that many requests.
: hehe, dataset just "looks faster" for busy web serive.
:
:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/bd
: adotnetarch031.asp
:
: In all of the preceding tests, we saw that DataReader outperformed DataSet.
As
: mentioned earlier, the DataReader offers better performance because it
avoids
: the performance and memory overhead associated with the creation of the
: DataSet.
:
: The DataReader is a better choice for applications that require optimized
: read-only and forward-only data access. The sooner you load the data off the
: DataReader, close the DataReader, and close the database connection, the
: better performance you get. Because the DataReader holds a database
connection
: that cannot be used for any other purpose while the application reads data,
it
: could limit scalability if the application holds the DataReader long enough
: for contention to occur. The DataSet only needs to hold a connection while
it
: is being populated. Once it is filled, the connection may be closed and
: returned to the pool. Delaying reading the data from the DataSet will not
: cause contention to occur, as the connection might have been returned to the
: pool already.
:
:
:

--
God,
give us grace to accept with serenity the things that cannot be changed,
courage to change the things which should be changed and the wisdom to disti
nguish the one from the other.

※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 199.3.]

 
away
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 3 ]

发信人: away (圣殿骑士), 信区: DotNet
标  题: Re: DataReader vs. DataSet
发信站: Unknown Space - 未名空间 (Wed Oct 22 12:08:19 2003) WWW-POST

From my experience, most of the time, DataReader could do the job fine except
sometimes, I need some complex calculation towards a big data set.  Probably,
i could achieve the same goal with SQL, but that would make the database too
slow.  In this case, dataset is used.  We do some sacrifice some memory, but
we saved the database.

【 在 kongzi (鸡龟骨滚羹) 的大作中提到: 】
: Personally I like dataset more than datareader.
: As you said datareader holds the connection exclusivly.Though the connection
: pooling is done by the framework in most of the cases.I still like to share
: the connection in my program if possible and it's clearer.
: 【 在 LodossWar (sleepycat) 的大作中提到: 】
: : My words on this:
: : dataset way is more scalable, especially for busy service(a lot of
: : connections). But datareader is faster if not that many requests.
: : hehe, dataset just "looks faster" for busy web serive.
: :
: :
:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/bd
: : adotnetarch031.asp
: :
: : In all of the preceding tests, we saw that DataReader outperformed
DataSet.
: As
: : mentioned earlier, the DataReader offers better performance because it
: avoids
: : the performance and memory overhead associated with the creation of the
: : DataSet.
: :
: : The DataReader is a better choice for applications that require optimized
: : read-only and forward-only data access. The sooner you load the data off
the
: : DataReader, close the DataReader, and close the database connection, the
: : better performance you get. Because the DataReader holds a database
: connection
: : that cannot be used for any other purpose while the application reads
data,
: it
: : could limit scalability if the application holds the DataReader long
enough
: : for contention to occur. The DataSet only needs to hold a connection while
: it
: : is being populated. Once it is filled, the connection may be closed and
: : returned to the pool. Delaying reading the data from the DataSet will not
: : cause contention to occur, as the connection might have been returned to
the
: : pool already.
: :
: :
: :
:

--

--I've seen better days.

※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 68.99.]

 
yourtt
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 4 ]

发信人: yourtt (太子湾), 信区: DotNet
标  题: Re: DataReader vs. DataSet
发信站: Unknown Space - 未名空间 (Wed Oct 22 17:48:46 2003) WWW-POST

I think the key is when you need sort of "real time" data, you have to use
datareader.

and it always compare to dataadaptor instead of dataset.

BTW, is the post really "your words" :)

【 在 LodossWar (sleepycat) 的大作中提到: 】
: My words on this:
: dataset way is more scalable, especially for busy service(a lot of
: connections). But datareader is faster if not that many requests.
: hehe, dataset just "looks faster" for busy web serive.
:
:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/bd
: adotnetarch031.asp
:
: In all of the preceding tests, we saw that DataReader outperformed DataSet.
As
: mentioned earlier, the DataReader offers better performance because it
avoids
: the performance and memory overhead associated with the creation of the
: DataSet.
:
: The DataReader is a better choice for applications that require optimized
: read-only and forward-only data access. The sooner you load the data off the
: DataReader, close the DataReader, and close the database connection, the
: better performance you get. Because the DataReader holds a database
connection
: that cannot be used for any other purpose while the application reads data,
it
: could limit scalability if the application holds the DataReader long enough
: for contention to occur. The DataSet only needs to hold a connection while
it
: is being populated. Once it is filled, the connection may be closed and
: returned to the pool. Delaying reading the data from the DataSet will not
: cause contention to occur, as the connection might have been returned to the
: pool already.
:
:
:

--
gentoo-1d, kde-3d, BIND-3d, DHCP-1d, APACHE-1d, VPN(PPTP)-3d, Samba-3d,  iptables_iproute-1w, Sendmail_saslauth_pop3_squirrelmail-1w, usb_wireless-1d, novell_ipx_route-2d, cups-1w, PDA(Axim)-1d.
**************************************************************************
have_everything_setup_running_flawless_payless_troubleless-priceless.
**************************************************************************
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 66.236.]

 
LodossWar
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 5 ]

发信人: LodossWar (sleepycat), 信区: DotNet
标  题: Re: DataReader vs. DataSet
发信站: Unknown Space - 未名空间 (Thu Oct 23 10:31:10 2003) WWW-POST

【 在 away (圣殿骑士) 的大作中提到: 】
: From my experience, most of the time, DataReader could do the job fine
except
: sometimes, I need some complex calculation towards a big data set.
Probably,
: i could achieve the same goal with SQL, but that would make the database too
: slow.  In this case, dataset is used.  We do some sacrifice some memory, but
: we saved the database.
     ~~~~~~~~~~~~~~~~~~~?
saved connections ba. :)

: 【 在 kongzi (鸡龟骨滚羹) 的大作中提到: 】
: : Personally I like dataset more than datareader.
: : As you said datareader holds the connection exclusivly.Though the
connection
: : pooling is done by the framework in most of the cases.I still like to
share
: : the connection in my program if possible and it's clearer.
: : 【 在 LodossWar (sleepycat) 的大作中提到: 】
: : : My words on this:
: : : dataset way is more scalable, especially for busy service(a lot of
: : : connections). But datareader is faster if not that many requests.
: : : hehe, dataset just "looks faster" for busy web serive.
: : :
: : :
: :
:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/bd
: : : adotnetarch031.asp
: : :
: : : In all of the preceding tests, we saw that DataReader outperformed
: DataSet.
: : As
: : : mentioned earlier, the DataReader offers better performance because it
: : avoids
: : : the performance and memory overhead associated with the creation of the
: : : DataSet.
: : :
: : : The DataReader is a better choice for applications that require
optimized
: : : read-only and forward-only data access. The sooner you load the data off
: the
: : : DataReader, close the DataReader, and close the database connection, the
: : : better performance you get. Because the DataReader holds a database
: : connection
: : : that cannot be used for any other purpose while the application reads
: data,
: : it
: : : could limit scalability if the application holds the DataReader long
: enough
: : : for contention to occur. The DataSet only needs to hold a connection
while
: : it
: : : is being populated. Once it is filled, the connection may be closed and
: : : returned to the pool. Delaying reading the data from the DataSet will
not
: : : cause contention to occur, as the connection might have been returned to
: the
: : : pool already.
: : :
: : :


--
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 151.201.]

 
kongzi
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 6 ]

发信人: kongzi (鸡龟骨滚羹), 信区: DotNet
标  题: Re: DataReader vs. DataSet
发信站: Unknown Space - 未名空间 (Thu Oct 23 11:37:16 2003) WWW-POST

【 在 LodossWar (sleepycat) 的大作中提到: 】
: 【 在 away (圣殿骑士) 的大作中提到: 】
: : From my experience, most of the time, DataReader could do the job fine
: except
: : sometimes, I need some complex calculation towards a big data set.
: Probably,
: : i could achieve the same goal with SQL, but that would make the database
too
: : slow.  In this case, dataset is used.  We do some sacrifice some memory,
but
: : we saved the database.
:      ~~~~~~~~~~~~~~~~~~~?
: saved connections ba. :)
I think he was talking about using the in-memory dataset saved huge
server-side oepration at the back-end.
:
: : 【 在 kongzi (鸡龟骨滚羹) 的大作中提到: 】
: : : Personally I like dataset more than datareader.
: : : As you said datareader holds the connection exclusivly.Though the
: connection
: : : pooling is done by the framework in most of the cases.I still like to
: share
: : : the connection in my program if possible and it's clearer.
: : : 【 在 LodossWar (sleepycat) 的大作中提到: 】
: : : : My words on this:
: : : : dataset way is more scalable, especially for busy service(a lot of
: : : : connections). But datareader is faster if not that many requests.
: : : : hehe, dataset just "looks faster" for busy web serive.
: : : :
: : : :
: : :
: :
:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/bd
: : : : adotnetarch031.asp
: : : :
: : : : In all of the preceding tests, we saw that DataReader outperformed
: : DataSet.
: : : As
: : : : mentioned earlier, the DataReader offers better performance because it
: : : avoids
: : : : the performance and memory overhead associated with the creation of
the
: : : : DataSet.
: : : :
: : : : The DataReader is a better choice for applications that require
: optimized
: : : : read-only and forward-only data access. The sooner you load the data
off
: : the
: : : : DataReader, close the DataReader, and close the database connection,
the
: : : : better performance you get. Because the DataReader holds a database
: : : connection
: : : : that cannot be used for any other purpose while the application reads
: : data,
: : : it
: : : : could limit scalability if the application holds the DataReader long
: : enough

--
God,
give us grace to accept with serenity the things that cannot be changed,
courage to change the things which should be changed and the wisdom to disti
nguish the one from the other.

※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 199.3.]

 
LodossWar
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 7 ]

发信人: LodossWar (sleepycat), 信区: DotNet
标  题: Re: DataReader vs. DataSet
发信站: Unknown Space - 未名空间 (Thu Oct 23 11:42:34 2003) WWW-POST

【 在 kongzi (鸡龟骨滚羹) 的大作中提到: 】
: 【 在 LodossWar (sleepycat) 的大作中提到: 】
: : 【 在 away (圣殿骑士) 的大作中提到: 】
: : : From my experience, most of the time, DataReader could do the job fine
: : except
: : : sometimes, I need some complex calculation towards a big data set.
: : Probably,
: : : i could achieve the same goal with SQL, but that would make the database
: too
: : : slow.  In this case, dataset is used.  We do some sacrifice some memory,
: but
: : : we saved the database.
: :      ~~~~~~~~~~~~~~~~~~~?
: : saved connections ba. :)
: I think he was talking about using the in-memory dataset saved huge
: server-side oepration at the back-end.
So the point here is using the "cache" in dataset to do computing, am I right?


--
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 151.201.]

 
away
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 8 ]

发信人: away (圣殿骑士), 信区: DotNet
标  题: Re: DataReader vs. DataSet
发信站: Unknown Space - 未名空间 (Thu Oct 23 12:02:13 2003), 站内信件


I mean, we saved a lot of database operations.
【 在 LodossWar (sleepycat) 的大作中提到: 】
: 【 在 kongzi (鸡龟骨滚羹) 的大作中提到: 】
: : too
: : but
: : I think he was talking about using the in-memory dataset saved huge
: : server-side oepration at the back-end.
: So the point here is using the "cache" in dataset to do computing, am I right?


--

--I've seen better days.

※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 68.99.]

 
LodossWar
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 9 ]

发信人: LodossWar (sleepycat), 信区: DotNet
标  题: Re: DataReader vs. DataSet
发信站: Unknown Space - 未名空间 (Thu Oct 23 12:11:21 2003) WWW-POST

Got you. I remembered some examples. SQL is not good at some sort of
calculation .

Thanks. :)

【 在 away (圣殿骑士) 的大作中提到: 】
:
: I mean, we saved a lot of database operations.
: 【 在 LodossWar (sleepycat) 的大作中提到: 】
: : 【 在 kongzi (鸡龟骨滚羹) 的大作中提到: 】
: : : too
: : : but
: : : I think he was talking about using the in-memory dataset saved huge
: : : server-side oepration at the back-end.
: : So the point here is using the "cache" in dataset to do computing, am I
right?
:
:


--
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 151.201.]

 
st
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 10 ]

发信人: st (月光下老虎慢慢吃人), 信区: DotNet
标  题: Re: DataReader vs. DataSet
发信站: Unknown Space - 未名空间 (Thu Oct 23 12:13:14 2003), 站内信件

nothing is good if it's over used. hehe. I always believe in something in
between. the previous manager likes "cool" M$ stuff, so they wrote sql proc
over 3k lines, which became a disaster to maintain, debug, optimize later.
also M$ sql server replication latency is a know issue, it can hardly be
determined when replication will be done and it causes heavy network traffic

【 在 LodossWar (sleepycat) 的大作中提到: 】
: Got you. I remembered some examples. SQL is not good at some sort of
: calculation .
: Thanks. :)
: 【 在 away (圣殿骑士) 的大作中提到: 】
: : I mean, we saved a lot of database operations.
: right?


--
一只小老虎慢慢的走了过来。红着脸,问小松鼠说,“请问。。。我可以吃你吗?”
小松鼠觉得这个问法蛮好玩的,说“你是第一次吃动物吗?”小老虎更不好意思了,说,
“是的。。。妈妈不在家了。。。”“那。。你以前吃什么呢?”小松鼠又好奇的问到。
“……”“什么?说大声点。。。我听不到”“吃奶!”说完,小老虎的脸更红更红了。
--[转载]月光下老虎慢慢吃人

※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 204.71.]

 
kongzi
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 11 ]

发信人: kongzi (鸡龟骨滚羹), 信区: DotNet
标  题: Re: DataReader vs. DataSet
发信站: Unknown Space - 未名空间 (Thu Oct 23 12:42:24 2003) WWW-POST

Really?I  mean the replication latency problem.I did the same thing in Sybase
replication server b4 and they worked well.Microsoft sql server is similar(if
not exact the same) to sybase.If it has such big latency problem,does it mean
that it's not suitbale for real time system?
btw,who can feed me the relationship(or history) between sybase sql server and
microsoft sql server?I am 2 lazy to do the research lah.
【 在 st (月光下老虎慢慢吃人) 的大作中提到: 】
: nothing is good if it's over used. hehe. I always believe in something in
: between. the previous manager likes "cool" M$ stuff, so they wrote sql proc
: over 3k lines, which became a disaster to maintain, debug, optimize later.
: also M$ sql server replication latency is a know issue, it can hardly be
: determined when replication will be done and it causes heavy network traffic
:
: 【 在 LodossWar (sleepycat) 的大作中提到: 】
: : Got you. I remembered some examples. SQL is not good at some sort of
: : calculation .
: : Thanks. :)
: : 【 在 away (圣殿骑士) 的大作中提到: 】
: : : I mean, we saved a lot of database operations.
: : right?
:
:



--
God,
give us grace to accept with serenity the things that cannot be changed,
courage to change the things which should be changed and the wisdom to disti
nguish the one from the other.

※ 修改:·kongzi 於 Oct 23 12:42:24 修改本文·[FROM: 199.3.]
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 199.3.]

 
st
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 12 ]

发信人: st (月光下老虎慢慢吃人), 信区: DotNet
标  题: Re: DataReader vs. DataSet
发信站: Unknown Space - 未名空间 (Thu Oct 23 12:45:19 2003), 站内信件

【 在 kongzi (鸡龟骨滚羹) 的大作中提到: 】
: Really?I  mean the replication latency problem.I did the same thing in Sybase
: replication server b4 and they worked well.Microsoft sql server is similar(if
: not exact the same) to sybase.If it has such big latency problem,does it mean
: that it's not suitbale for real time system?
I would suspect so, due to this problem, we use our own middleware for
real time and delayed quote delivery.

: btw,who can feed me the relationship(or history) between sybase sql server and
: microsoft sql server?I am 2 lazy to do the research lah.
: 【 在 st (月光下老虎慢慢吃人) 的大作中提到: 】
: : nothing is good if it's over used. hehe. I always believe in something in
: : between. the previous manager likes "cool" M$ stuff, so they wrote sql proc
: : over 3k lines, which became a disaster to maintain, debug, optimize later.
: : also M$ sql server replication latency is a know issue, it can hardly be
: : determined when replication will be done and it causes heavy network traffic


--
一只小老虎慢慢的走了过来。红着脸,问小松鼠说,“请问。。。我可以吃你吗?”
小松鼠觉得这个问法蛮好玩的,说“你是第一次吃动物吗?”小老虎更不好意思了,说,
“是的。。。妈妈不在家了。。。”“那。。你以前吃什么呢?”小松鼠又好奇的问到。
“……”“什么?说大声点。。。我听不到”“吃奶!”说完,小老虎的脸更红更红了。
--[转载]月光下老虎慢慢吃人

※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 204.71.]

[分页:1 ]
[快速返回] [ 进入窗口里的风景讨论区] [返回顶部]
回复文章
标题:
内 容:

未名交友
将您的链接放在这儿

友情链接


 

Site Map - Contact Us - Terms and Conditions - Privacy Policy

版权所有,未名空间(mitbbs.com),since 1996