Re: Performance & SQL Formatting Issue

2009-06-04 Thread Pascal Jacob
ff Butler [mailto:jeffgbut...@gmail.com] Sent: Wednesday, February 04, 2009 12:22 PM To: user-java@ibatis.apache.org Subject: Re: Performance & SQL Formatting Issue I duplicated this code but removed all the external dependencies (Spring, DBCP, etc.). I just stripped it down to plain iBATIS and MySQL. M

Re: Performance & SQL Formatting Issue

2009-06-03 Thread Pascal Jacob
ds [FORMATTED]: 1719 -Original Message- From: Jeff Butler [mailto:jeffgbut...@gmail.com] Sent: Wednesday, February 04, 2009 12:22 PM To: user-java@ibatis.apache.org Subject: Re: Performance & SQL Formatting Issue I duplicated this code but removed all the external dependencies (Spring

Re: Performance & SQL Formatting Issue

2009-02-04 Thread Larry Meadors
Wow, good troubleshooting, and thanks for sharing the real issue. Larry

RE: Performance & SQL Formatting Issue

2009-02-04 Thread M Goodell
li-seconds [FORMATTED]: 1719 -Original Message- From: Jeff Butler [mailto:jeffgbut...@gmail.com] Sent: Wednesday, February 04, 2009 12:22 PM To: user-java@ibatis.apache.org Subject: Re: Performance & SQL Formatting Issue I duplicated this code but removed all the external dependencies (Spr

Re: Performance & SQL Formatting Issue

2009-02-04 Thread Jeff Butler
I duplicated this code but removed all the external dependencies (Spring, DBCP, etc.). I just stripped it down to plain iBATIS and MySQL. My results show this: 2 Unformatted Inserts: 3 seconds Avg. 2 Formatted Inserts: 2.5 seconds Avg. HOWEVER, if I reverse the order in which the method

Re: Performance & SQL Formatting Issue

2009-02-03 Thread Clinton Begin
Thanks for running these tests Jeff I'll roll back the change I made unless it's confirmed that formatting is an issue. Clinton On Tue, Feb 3, 2009 at 4:37 PM, Jeff Butler wrote: > I'll take that challenge! :) > > In the test as distributed, each insert is a new transaction so there > is

Re: Performance & SQL Formatting Issue

2009-02-03 Thread Jeff Butler
I'll take that challenge! :) In the test as distributed, each insert is a new transaction so there is no statement caching. I reran the test making all the inserts into one transaction - and then with and without statement caching enabled. As you might imaging, the performance was far superior -

Re: Performance & SQL Formatting Issue

2009-02-03 Thread Chema
20 sec 42 secs >>>> >>>> Again, I am more than willing to provide logs, application code whatever to >>>> assist in a resolution. >>>> >>>> Regards, >>>> >>>> M. Goodell >>>> >>>> --

Re: Performance & SQL Formatting Issue

2009-02-03 Thread Clinton Begin
Original Message- >> From: Clinton Begin [mailto:clinton.be...@gmail.com] >> Sent: Monday, February 02, 2009 12:42 PM >> To: user-java@ibatis.apache.org; li...@pdc4u.com >> Subject: Re: Performance & SQL Formatting Issue >> >> This is a good su

RE: Performance & SQL Formatting Issue

2009-02-03 Thread M Goodell
ry 03, 2009 10:12 AM To: user-java@ibatis.apache.org Subject: Re: Performance & SQL Formatting Issue could you attach a stripped down maven/ant/eclipse whatever project with your testcase against an in memory db? Or can you only reproduce the issue with a "real" db? Regards Kai ---

Re: Performance & SQL Formatting Issue

2009-02-03 Thread Kai Grabfelder
il.com] > Sent: Monday, February 02, 2009 12:42 PM > To: user-java@ibatis.apache.org; li...@pdc4u.com > Subject: Re: Performance & SQL Formatting Issue > > This is a good summary. I've been watching the other thread. > > I think I might have found a possible candida

RE: Performance & SQL Formatting Issue

2009-02-03 Thread M Goodell
@ibatis.apache.org; li...@pdc4u.com Subject: Re: Performance & SQL Formatting Issue This is a good summary. I've been watching the other thread. I think I might have found a possible candidate: public class SqlText implements SqlChild { //... public void setText(String text) {

Re: Performance & SQL Formatting Issue

2009-02-03 Thread Clinton Begin
Wow :-) Let's look at this for what it is guys... it's no t hard to fix and there's no need to over-complicate the solution. That code exists simply because some JDBC drivers in the past did not like whitespace, so it was trimmed from all statements. Perhaps it's time (in 2009) to remove thi

Re: Performance & SQL Formatting Issue

2009-02-03 Thread Chema
> 2009/2/3 Clinton Begin : > The statement cache operates only within a session/transaction scope, > not between threads or users. So it would entirely depend on the > overall approach. > > Clinton Well, I supposed that all operation was made in the same thread (maybe different transactions), wi

Re: Performance & SQL Formatting Issue

2009-02-02 Thread Jiming Liu
Hi Clinton, BTW, I suggest you could consider expose interface like SqlChild to users, so that users could inject their own implementations. Thanks, Jiming On Tue, Feb 3, 2009 at 1:22 PM, Jiming Liu wrote: > Hi Clinton, > > I suppose formatted sql is slow might be caused by database engine w

Re: Performance & SQL Formatting Issue

2009-02-02 Thread Jiming Liu
Hi Clinton, I suppose formatted sql is slow might be caused by database engine waste time to parse the white space, not only \r,\n,\t, but ' ' as well. And actually ' ' is more than the other three white in real world. So I recommend following code, public static String tidySql(String sql)

Re: Performance & SQL Formatting Issue

2009-02-02 Thread Clinton Begin
The statement cache operates only within a session/transaction scope, not between threads or users. So it would entirely depend on the overall approach. Clinton On Mon, Feb 2, 2009 at 1:06 PM, Chema wrote: > Then, does this mean that prepared statement cache isn't working right ? > > I don't kn

Re: Performance & SQL Formatting Issue

2009-02-02 Thread Kai Grabfelder
wow that would be an interesting one! --- Original Nachricht --- Absender: Clinton Begin Datum: 02.02.2009 20:41 > This is a good summary. I've been watching the other thread. > > I think I might have found a possible candidate: > > public class SqlText implements SqlChild { > //... > publi

Re: Performance & SQL Formatting Issue

2009-02-02 Thread Chema
Then, does this mean that prepared statement cache isn't working right ? I don't know how cache works but I understand that every non-dynamic statement is build as a prepared statement and cached. So, XML file shouldn't be parsed if a same statement id is called several times. By this reason, it d

Re: Performance & SQL Formatting Issue

2009-02-02 Thread Clinton Begin
This is a good summary. I've been watching the other thread. I think I might have found a possible candidate: public class SqlText implements SqlChild { //... public void setText(String text) { this.text = text.replace('\r', ' ').replace('\n', ' ').replace('\t', ' '); this.isWhiteSpa