<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for Software Quality is Quality of Life</title>
	<atom:link href="http://blog.fatalmind.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fatalmind.com</link>
	<description>Markus Winand&#039;s blog about Performance, Reliability, Maintainability, Scalability and more</description>
	<lastBuildDate>Tue, 27 Sep 2011 23:33:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>Comment on Use The Index, Luke! by Chinmay (@cschandragiri)</title>
		<link>http://blog.fatalmind.com/2010/08/15/use-the-index-luke/#comment-1567</link>
		<dc:creator><![CDATA[Chinmay (@cschandragiri)]]></dc:creator>
		<pubDate>Tue, 27 Sep 2011 23:33:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fatalmind.com/?p=937#comment-1567</guid>
		<description><![CDATA[Hi Mark,

   Enjoyed reading your book, the concepts are well explained. Thanks for sharing it to the open community.

Chinmay]]></description>
		<content:encoded><![CDATA[<p>Hi Mark,</p>
<p>   Enjoyed reading your book, the concepts are well explained. Thanks for sharing it to the open community.</p>
<p>Chinmay</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing NoSQL For The Right Reason by Instead of &#8220;NoSQL&#8221; Should You Be Thinking &#8220;NoDatabase&#8221;? &#124; SiliconANGLE</title>
		<link>http://blog.fatalmind.com/2011/05/13/choosing-nosql-for-the-right-reason/#comment-1461</link>
		<dc:creator><![CDATA[Instead of &#8220;NoSQL&#8221; Should You Be Thinking &#8220;NoDatabase&#8221;? &#124; SiliconANGLE]]></dc:creator>
		<pubDate>Wed, 07 Sep 2011 03:36:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fatalmind.com/?p=991#comment-1461</guid>
		<description><![CDATA[[...] Winand made the case earlier this year that the version control system Git is actually a NoSQL datastore. The blog [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Winand made the case earlier this year that the version control system Git is actually a NoSQL datastore. The blog [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing NoSQL For The Right Reason by Markus Winand</title>
		<link>http://blog.fatalmind.com/2011/05/13/choosing-nosql-for-the-right-reason/#comment-1021</link>
		<dc:creator><![CDATA[Markus Winand]]></dc:creator>
		<pubDate>Mon, 16 May 2011 13:19:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fatalmind.com/?p=991#comment-1021</guid>
		<description><![CDATA[Well, in lack of a definition for &quot;NoSQL semantics&quot; I like to see the CAP Theorem as the central star that NoSQL systems orbit around.

That said, I believe that any application where partition tolerance is more important than consistency is a good fit for NoSQL. Partition tolerance seems to be poorly understood in the field. I took the Git example because many developers know what &quot;distributed&quot; means in context of Git. I could have taken any other distributed, partition tolerant revision control system for that purpose. Source code repositories are a particularly good fit because they hardly every reach consistency anyway.

The question—what is more important, partition tolerance or consistency—depends on the data. Huge social networks have to cope with tons of data that has very little value. Strict consistency doesn&#039;t pay off for that. The damage caused by conflicts is little compared to the costs to establish strict consistency. That argument is, however, nonexistent for small sites because consistency is easy to achieve there.

I also mentioned BLOBs in the article. As a software architect, I have been involved in many discussions where to store low value binary data like user uploads. I remember a meeting where the DBA smashed the proposal to use BLOBs for  vast amounts of user data by proclaiming that &quot;BLOBs have no business in my database&quot;. BLOBs have, quite often, little value—even if connected to high value relational data. From that angle, I believe that some NoSQL systems make a great distributed BLOB store which can coexist with a relational database.

Scaling writes is subject to Brewer&#039;s CAP Theorem—take two out of three. Sharding and similar methods bypass it by not distributing the data at large—that is, only a small subset of the nodes is responsible to maintain a particular data sub-set.

I feel, however, that the need to scale out is constantly decreasing for most applications. I have observed a multi-national banking system over the past decade. It was initially running on a huge two node active-active cluster to distribute load. A few years later, it was moved to a hot-standby cluster—just one node active. Today, it&#039;s being migrated to a virtualized server running other databases on the same hardware. &quot;Scale-out&quot; is not the trend—virtualization is, at least in enterprise environments. Huge social sites being the obvious exception.]]></description>
		<content:encoded><![CDATA[<p>Well, in lack of a definition for &#8220;NoSQL semantics&#8221; I like to see the CAP Theorem as the central star that NoSQL systems orbit around.</p>
<p>That said, I believe that any application where partition tolerance is more important than consistency is a good fit for NoSQL. Partition tolerance seems to be poorly understood in the field. I took the Git example because many developers know what &#8220;distributed&#8221; means in context of Git. I could have taken any other distributed, partition tolerant revision control system for that purpose. Source code repositories are a particularly good fit because they hardly every reach consistency anyway.</p>
<p>The question—what is more important, partition tolerance or consistency—depends on the data. Huge social networks have to cope with tons of data that has very little value. Strict consistency doesn&#8217;t pay off for that. The damage caused by conflicts is little compared to the costs to establish strict consistency. That argument is, however, nonexistent for small sites because consistency is easy to achieve there.</p>
<p>I also mentioned BLOBs in the article. As a software architect, I have been involved in many discussions where to store low value binary data like user uploads. I remember a meeting where the DBA smashed the proposal to use BLOBs for  vast amounts of user data by proclaiming that &#8220;BLOBs have no business in my database&#8221;. BLOBs have, quite often, little value—even if connected to high value relational data. From that angle, I believe that some NoSQL systems make a great distributed BLOB store which can coexist with a relational database.</p>
<p>Scaling writes is subject to Brewer&#8217;s CAP Theorem—take two out of three. Sharding and similar methods bypass it by not distributing the data at large—that is, only a small subset of the nodes is responsible to maintain a particular data sub-set.</p>
<p>I feel, however, that the need to scale out is constantly decreasing for most applications. I have observed a multi-national banking system over the past decade. It was initially running on a huge two node active-active cluster to distribute load. A few years later, it was moved to a hot-standby cluster—just one node active. Today, it&#8217;s being migrated to a virtualized server running other databases on the same hardware. &#8220;Scale-out&#8221; is not the trend—virtualization is, at least in enterprise environments. Huge social sites being the obvious exception.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing NoSQL For The Right Reason by Giorgio</title>
		<link>http://blog.fatalmind.com/2011/05/13/choosing-nosql-for-the-right-reason/#comment-1020</link>
		<dc:creator><![CDATA[Giorgio]]></dc:creator>
		<pubDate>Mon, 16 May 2011 11:57:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fatalmind.com/?p=991#comment-1020</guid>
		<description><![CDATA[Nice post, Git being close to a NoSQL system shows how little the word &quot;NoSQL&quot; actually means.]]></description>
		<content:encoded><![CDATA[<p>Nice post, Git being close to a NoSQL system shows how little the word &#8220;NoSQL&#8221; actually means.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing NoSQL For The Right Reason by Deniz Oguz</title>
		<link>http://blog.fatalmind.com/2011/05/13/choosing-nosql-for-the-right-reason/#comment-1019</link>
		<dc:creator><![CDATA[Deniz Oguz]]></dc:creator>
		<pubDate>Mon, 16 May 2011 10:22:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fatalmind.com/?p=991#comment-1019</guid>
		<description><![CDATA[&quot;No doubt, NoSQL is a better fit for some applications.&quot;

Other than performance, could you provide examples of applications that are more suitable to NoSQL semantics? SQL has all other advantages, like persistence frameworks, consistency, and other tools. NoSQL solutions like cassandra are target for scaling writes. Other than sharding how do you think to scale writes on a RDMS?]]></description>
		<content:encoded><![CDATA[<p>&#8220;No doubt, NoSQL is a better fit for some applications.&#8221;</p>
<p>Other than performance, could you provide examples of applications that are more suitable to NoSQL semantics? SQL has all other advantages, like persistence frameworks, consistency, and other tools. NoSQL solutions like cassandra are target for scaling writes. Other than sharding how do you think to scale writes on a RDMS?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing NoSQL For The Right Reason by Markus Winand</title>
		<link>http://blog.fatalmind.com/2011/05/13/choosing-nosql-for-the-right-reason/#comment-1015</link>
		<dc:creator><![CDATA[Markus Winand]]></dc:creator>
		<pubDate>Sat, 14 May 2011 15:10:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fatalmind.com/?p=991#comment-1015</guid>
		<description><![CDATA[&quot;The main reason you run into performance problems with relational databases is because the data model has problems.&quot;

Well, I made another observation. In fact, everybody knows that database design is important and must be done carefully. There are many books covering that in more or less detail. I do not say that database design is not important, but I say it&#039;s usually done carefully anyway because everybody knows it&#039;s important.

What I find at client sites is that developers are not aware how to index properly and how to write queries that can benefit from indexing. The DBAs, on the other hand, know about indexing but don&#039;t have the deep domain knowledge to know how the data is queried.

Nobody ignores schema design but indexing is almost always ignored until it&#039;s too late. Adding some more or less random indexes might improve the situation, but it is exactly what I refer to as &quot;improper&quot; indexing. Indexing without a plan. In fact, my position is that indexing must be designed with the same care as the schema.

I pretty much agree with your statements about NoSQL.]]></description>
		<content:encoded><![CDATA[<p>&#8220;The main reason you run into performance problems with relational databases is because the data model has problems.&#8221;</p>
<p>Well, I made another observation. In fact, everybody knows that database design is important and must be done carefully. There are many books covering that in more or less detail. I do not say that database design is not important, but I say it&#8217;s usually done carefully anyway because everybody knows it&#8217;s important.</p>
<p>What I find at client sites is that developers are not aware how to index properly and how to write queries that can benefit from indexing. The DBAs, on the other hand, know about indexing but don&#8217;t have the deep domain knowledge to know how the data is queried.</p>
<p>Nobody ignores schema design but indexing is almost always ignored until it&#8217;s too late. Adding some more or less random indexes might improve the situation, but it is exactly what I refer to as &#8220;improper&#8221; indexing. Indexing without a plan. In fact, my position is that indexing must be designed with the same care as the schema.</p>
<p>I pretty much agree with your statements about NoSQL.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Choosing NoSQL For The Right Reason by Gruntle Grüber</title>
		<link>http://blog.fatalmind.com/2011/05/13/choosing-nosql-for-the-right-reason/#comment-1012</link>
		<dc:creator><![CDATA[Gruntle Grüber]]></dc:creator>
		<pubDate>Sat, 14 May 2011 08:28:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fatalmind.com/?p=991#comment-1012</guid>
		<description><![CDATA[&quot;Most SQL performance problems result out of improper indexing.&quot;

I&#039;m sorry, but that is simply not true.  The main reason you run into performance problems with relational databases is because the data model has problems. Indices are more like &quot;inherent opportunities&quot; to speed things up here and there, but the main performance comes from understanding the data, understanding the access patterns and understanding how the SQL engine will calculate a plan.  And then designing a relational model that will balance these things out.

Designing a relational model that performs well is hard.  Which is why there are so few database professionals available who seem able to do this well.  It requires deep understanding of both the domain that needs to be modeled as well as the technology it will run on.

Just tweaking indices is going to work for a small subset of problems, but the real performance gains are made during the design of the relational model you will use.  And unfortunately, they do not teach this in school.  

Also, the whole NoSQL vs SQL debate is artificial.  There is no real debate:  they address entirely different classes of problems.  It can be boiled down to this:  SQL is about consistency and flexibility during querying at the expense of scalability and performance.  

NoSQL is about &quot;performance at scale&quot;and flexibility when writing data at the expense of consistency and querying flexibility.  Note that I said &quot;performance at scale&quot;, because many of the NoSQL databases do not have particularly impressive performance for small datasets. 

Sacrificing absolute consistency is hard,  but as it turns out, for a lot of &quot;new&quot; problems lack of consistency is less of a problem than long response times.  The &quot;new&quot; problems here are online systems with massive numbers of users. For some classes of companies you can feel this directly.  Most online banks are still pretty slow.  Sites like Amazon, on the other hand are quite snappy given that they have a lot more web traffic than any bank.  (And when it comes to online commerce, every millisecond counts).

A system can be said to be scalable when the cost of increasing its size is sublinear with respect to the dimension you need to scale.  Since the relational model is inherently expensive to apply in a distributed manner, it is relatively easy to show that you cannot get sublinear cost for arbitrary scale along any dimension.

However, with certain sacrifices you can get sublinear cost.  For instance by breaking the relational model somewhat and partitioning the data into independent instances that have no dependencies on other instances.

Note that when we say &quot;cost&quot; we mostly talk in terms of latency and processing power.  Not dollars.  Although it will end up costing dollars.

SQL has its place and NoSQL has its place, but it is important to understand that they address different types of problems.  I have worked at companies that have naively used SQL databases for NoSQL type problems and vice versa.  It is unhelpful that people keep comparing them directly instead of trying to develop and disseminate the kind of knowledge needed to reason about this.

Also it doesn&#039;t help that Stonebreaker et al, to draw attention to themselves, muddy the waters and confuse the issues by planting the idea that NoSQL is somehow the antithesis of SQL.  In fact the label &quot;NoSQL&quot; has been incredibly unhelpful because it suggests that there is a problem with SQL and that NoSQL is the magic solution.  This is, at best, naive.  And unfortunately leads people to get hung up on the wrong ideas.]]></description>
		<content:encoded><![CDATA[<p>&#8220;Most SQL performance problems result out of improper indexing.&#8221;</p>
<p>I&#8217;m sorry, but that is simply not true.  The main reason you run into performance problems with relational databases is because the data model has problems. Indices are more like &#8220;inherent opportunities&#8221; to speed things up here and there, but the main performance comes from understanding the data, understanding the access patterns and understanding how the SQL engine will calculate a plan.  And then designing a relational model that will balance these things out.</p>
<p>Designing a relational model that performs well is hard.  Which is why there are so few database professionals available who seem able to do this well.  It requires deep understanding of both the domain that needs to be modeled as well as the technology it will run on.</p>
<p>Just tweaking indices is going to work for a small subset of problems, but the real performance gains are made during the design of the relational model you will use.  And unfortunately, they do not teach this in school.  </p>
<p>Also, the whole NoSQL vs SQL debate is artificial.  There is no real debate:  they address entirely different classes of problems.  It can be boiled down to this:  SQL is about consistency and flexibility during querying at the expense of scalability and performance.  </p>
<p>NoSQL is about &#8220;performance at scale&#8221;and flexibility when writing data at the expense of consistency and querying flexibility.  Note that I said &#8220;performance at scale&#8221;, because many of the NoSQL databases do not have particularly impressive performance for small datasets. </p>
<p>Sacrificing absolute consistency is hard,  but as it turns out, for a lot of &#8220;new&#8221; problems lack of consistency is less of a problem than long response times.  The &#8220;new&#8221; problems here are online systems with massive numbers of users. For some classes of companies you can feel this directly.  Most online banks are still pretty slow.  Sites like Amazon, on the other hand are quite snappy given that they have a lot more web traffic than any bank.  (And when it comes to online commerce, every millisecond counts).</p>
<p>A system can be said to be scalable when the cost of increasing its size is sublinear with respect to the dimension you need to scale.  Since the relational model is inherently expensive to apply in a distributed manner, it is relatively easy to show that you cannot get sublinear cost for arbitrary scale along any dimension.</p>
<p>However, with certain sacrifices you can get sublinear cost.  For instance by breaking the relational model somewhat and partitioning the data into independent instances that have no dependencies on other instances.</p>
<p>Note that when we say &#8220;cost&#8221; we mostly talk in terms of latency and processing power.  Not dollars.  Although it will end up costing dollars.</p>
<p>SQL has its place and NoSQL has its place, but it is important to understand that they address different types of problems.  I have worked at companies that have naively used SQL databases for NoSQL type problems and vice versa.  It is unhelpful that people keep comparing them directly instead of trying to develop and disseminate the kind of knowledge needed to reason about this.</p>
<p>Also it doesn&#8217;t help that Stonebreaker et al, to draw attention to themselves, muddy the waters and confuse the issues by planting the idea that NoSQL is somehow the antithesis of SQL.  In fact the label &#8220;NoSQL&#8221; has been incredibly unhelpful because it suggests that there is a problem with SQL and that NoSQL is the magic solution.  This is, at best, naive.  And unfortunately leads people to get hung up on the wrong ideas.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Oracle JDBC PreFetch Portability by Vijay Panchal</title>
		<link>http://blog.fatalmind.com/2010/01/29/oracle-jdbc-prefetch-portability/#comment-362</link>
		<dc:creator><![CDATA[Vijay Panchal]]></dc:creator>
		<pubDate>Mon, 13 Sep 2010 16:06:02 +0000</pubDate>
		<guid isPermaLink="false">http://myfatalmind.wordpress.com/?p=159#comment-362</guid>
		<description><![CDATA[Thanks Markus. To eliminate any problem due to network, I was running these test from an unix box co-located with the DB server in the same Data Center. I am pretty confident there is very very minimal impact of network if any. Also I made another change to the code. So instead of returning cursor from proc. I just populate temp table using proc and then wrote PreparedStatement and ran seperate query (in same session) to fetch all results from temp table. Here I am seeing difference in response times based on fetchsize. (Results below). However by doing so I am incurring extra cost of running another query which I want to avoid and somehow make setFetchSize to work with Cursor and Stored procedure itself. I will try to follow up with Oracle to see if they can help looking at the Driver.

final static String seqsql_new = &quot;SELECT DISTINCT av.*  FROM ab4p.alloc_review_vw av WHERE alloc_id = 2267294&quot;; 

  static int
    executeTest(CallableStatement ps, PreparedStatement ps_new)
    throws SQLException
  {
    int cnt = 0;
    //ps.setInt(1, 100000);
     // ps.execute(); -- this is run from outside 
      //Get Resultset from SP
     //ResultSet rs = (ResultSet) ps.getObject(1);
      
      //Get Result set from qury to Temp Table produced by SP.
      ResultSet rs = ps_new.executeQuery();
      
    while (rs.next()) {
      ++cnt;
    }
    rs.close();
    return cnt;
  }

Results using PreparedStatement for Fetching data after Proc run
----------------------------------------------------------------

	Time for ResultSet.next() loop 	
FetchSize	first run	second run
1	        42784	          42951
10	        11673	          11863
5000	        8037	          7645
10000	        8373	          7985

Note: I had to run the test with different data item this time. 
Again thanks a lot for all your comments.]]></description>
		<content:encoded><![CDATA[<p>Thanks Markus. To eliminate any problem due to network, I was running these test from an unix box co-located with the DB server in the same Data Center. I am pretty confident there is very very minimal impact of network if any. Also I made another change to the code. So instead of returning cursor from proc. I just populate temp table using proc and then wrote PreparedStatement and ran seperate query (in same session) to fetch all results from temp table. Here I am seeing difference in response times based on fetchsize. (Results below). However by doing so I am incurring extra cost of running another query which I want to avoid and somehow make setFetchSize to work with Cursor and Stored procedure itself. I will try to follow up with Oracle to see if they can help looking at the Driver.</p>
<p>final static String seqsql_new = &#8220;SELECT DISTINCT av.*  FROM ab4p.alloc_review_vw av WHERE alloc_id = 2267294&#8243;; </p>
<p>  static int<br />
    executeTest(CallableStatement ps, PreparedStatement ps_new)<br />
    throws SQLException<br />
  {<br />
    int cnt = 0;<br />
    //ps.setInt(1, 100000);<br />
     // ps.execute(); &#8212; this is run from outside<br />
      //Get Resultset from SP<br />
     //ResultSet rs = (ResultSet) ps.getObject(1);</p>
<p>      //Get Result set from qury to Temp Table produced by SP.<br />
      ResultSet rs = ps_new.executeQuery();</p>
<p>    while (rs.next()) {<br />
      ++cnt;<br />
    }<br />
    rs.close();<br />
    return cnt;<br />
  }</p>
<p>Results using PreparedStatement for Fetching data after Proc run<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>	Time for ResultSet.next() loop<br />
FetchSize	first run	second run<br />
1	        42784	          42951<br />
10	        11673	          11863<br />
5000	        8037	          7645<br />
10000	        8373	          7985</p>
<p>Note: I had to run the test with different data item this time.<br />
Again thanks a lot for all your comments.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Oracle JDBC PreFetch Portability by Markus Winand</title>
		<link>http://blog.fatalmind.com/2010/01/29/oracle-jdbc-prefetch-portability/#comment-360</link>
		<dc:creator><![CDATA[Markus Winand]]></dc:creator>
		<pubDate>Mon, 13 Sep 2010 13:13:07 +0000</pubDate>
		<guid isPermaLink="false">http://myfatalmind.wordpress.com/?p=159#comment-360</guid>
		<description><![CDATA[Dear Vijay,

I like to respond fast, if I can.

As I mentioned in my previous comment, I have never tested that thing with REFCURSORS—however, might be an interesting topic. Unfortunately I do not have the timeto look into that in much detail.

Regardless of that, the figures you sent made me doubt that your problem is related to the network latency—at least not within a LAN. A typical network latency in a LAN is 0.xx (zero-dot-something) milliseconds. Let&#039;s assume it is 1 ms, that would sum up to about 3.2 seconds for all the server round trips—about 15% of the overall execution time. Unless you are doing this on a WAN or you have a really slow LAN, I&#039;d guess that the performance bottleneck is the procedure itself, not the data transfer to the client.

However, your observation is interesting. I hope I can have a closer look at it some other time.]]></description>
		<content:encoded><![CDATA[<p>Dear Vijay,</p>
<p>I like to respond fast, if I can.</p>
<p>As I mentioned in my previous comment, I have never tested that thing with REFCURSORS—however, might be an interesting topic. Unfortunately I do not have the timeto look into that in much detail.</p>
<p>Regardless of that, the figures you sent made me doubt that your problem is related to the network latency—at least not within a LAN. A typical network latency in a LAN is 0.xx (zero-dot-something) milliseconds. Let&#8217;s assume it is 1 ms, that would sum up to about 3.2 seconds for all the server round trips—about 15% of the overall execution time. Unless you are doing this on a WAN or you have a really slow LAN, I&#8217;d guess that the performance bottleneck is the procedure itself, not the data transfer to the client.</p>
<p>However, your observation is interesting. I hope I can have a closer look at it some other time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Oracle JDBC PreFetch Portability by Vijay Panchal</title>
		<link>http://blog.fatalmind.com/2010/01/29/oracle-jdbc-prefetch-portability/#comment-359</link>
		<dc:creator><![CDATA[Vijay Panchal]]></dc:creator>
		<pubDate>Mon, 13 Sep 2010 12:49:42 +0000</pubDate>
		<guid isPermaLink="false">http://myfatalmind.wordpress.com/?p=159#comment-359</guid>
		<description><![CDATA[Thanks Markus for the prompt reply. I am attaching part of the updated code I updated here. My stored procedure is creating a global temp table and it is being returned as OracleTypes.CURSOR. 
I see that about 5 seconds is taken in executing the proc and 20 seconds in ResultSet.next loop. I am expecting reduction from 20seconds by prefetch. Do you think my understanding is right? Thanks again. 
updated program-
*************
	con.setAutoCommit(false);
	CallableStatement ps = con.prepareCall(&quot;{call review_allocation_pkg.review_proc(?,?)}&quot;);
	//statement.registerOutParameter(1, OracleTypes.CURSOR);
	ps.registerOutParameter(1, OracleTypes.CURSOR);
	ps.setString(2, &quot;2267294&quot;);
        setFetchSize(ps, argv[3]);
********************

  static int
    executeTest(CallableStatement ps)
    throws SQLException
  {
    int cnt = 0;
    //ps.setInt(1, 100000);
      ps.execute();
     ResultSet rs = (ResultSet) ps.getObject(1);
    while (rs.next()) {
      ++cnt;
    }
    rs.close();
    return cnt;
  }
**********************
Result1-

getFetchSize(): 10
getFetchSize(): 1
31850 rows fetched in 3187 server round trips and 21446 ms
*********************
Result 2-

getFetchSize(): 10
getFetchSize(): 1000
31850 rows fetched in 3187 server round trips and 20927 ms]]></description>
		<content:encoded><![CDATA[<p>Thanks Markus for the prompt reply. I am attaching part of the updated code I updated here. My stored procedure is creating a global temp table and it is being returned as OracleTypes.CURSOR.<br />
I see that about 5 seconds is taken in executing the proc and 20 seconds in ResultSet.next loop. I am expecting reduction from 20seconds by prefetch. Do you think my understanding is right? Thanks again.<br />
updated program-<br />
*************<br />
	con.setAutoCommit(false);<br />
	CallableStatement ps = con.prepareCall(&#8220;{call review_allocation_pkg.review_proc(?,?)}&#8221;);<br />
	//statement.registerOutParameter(1, OracleTypes.CURSOR);<br />
	ps.registerOutParameter(1, OracleTypes.CURSOR);<br />
	ps.setString(2, &#8220;2267294&#8243;);<br />
        setFetchSize(ps, argv[3]);<br />
********************</p>
<p>  static int<br />
    executeTest(CallableStatement ps)<br />
    throws SQLException<br />
  {<br />
    int cnt = 0;<br />
    //ps.setInt(1, 100000);<br />
      ps.execute();<br />
     ResultSet rs = (ResultSet) ps.getObject(1);<br />
    while (rs.next()) {<br />
      ++cnt;<br />
    }<br />
    rs.close();<br />
    return cnt;<br />
  }<br />
**********************<br />
Result1-</p>
<p>getFetchSize(): 10<br />
getFetchSize(): 1<br />
31850 rows fetched in 3187 server round trips and 21446 ms<br />
*********************<br />
Result 2-</p>
<p>getFetchSize(): 10<br />
getFetchSize(): 1000<br />
31850 rows fetched in 3187 server round trips and 20927 ms</p>
]]></content:encoded>
	</item>
</channel>
</rss>

