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 - about 1.5 seconds for each set of 10,000 inserts. Again, no noticeable difference between formatted and unformatted SQL. The statement cache did knock off about 0.2 seconds off execution time - I guess that's a good improvement. The point for me is that the formatting of the SQL has nothing to do with performance. The difference was whether each insert was a separate transaction, or whether there was one transaction for all inserts. Interesting - I see about the same vast difference in performance as reported by M Goodal, but the difference is the transactional configuration - NOT the format of the SQL. Jeff Butler On Tue, Feb 3, 2009 at 4:49 PM, Chema <demablo...@gmail.com> wrote: > I'm sorry to ask it again : > > about PerformanceTest.java by Jeff , all inserts inside loop are > executed in same thread > > I guess first one is cached into statement cache, isn't it ? > So, this test wouldn't be right because text formatting is performed > only one time. > > If I'm wrong in my concept about working of statement cache, please, tell me > > Thanks and regards > > >