Hi Michelle,

The performance boost is associated with using the jpox property org.jpox.identifier.defaultSchemaName to specify the schema in which the tables are installed. There is a performance boost whether the tables are installed in a named schema or the default schema when this property is set. I see an improvement of about 5.8x.
I see. The table name qualification of JPOX generated SQL statements depends on this property. This means, the performance of Derby depends on table name qualification.

This is curious, because Derby qualifies table names with the default schema name in case of unqualified table names. The default schema name equals the user name. The user name is part of the connection URL. For this reason, all informations for Derby implicit qualification are part of the connection - no need for a costly default schema lookup by Derby. I looked into the tuning document of Derby, but could not find any note about this fact.

However, I have a question:

The property "org.jpox.identifier.defaultSchemaName" is passed as system property. This is good because the default schema depends on the identity type. However, there are a number of other JPOX properties which are passed as java.util.Properties. Should we document somewhere that the default schema name property is passed as system property?

Regards,
Michael


I've attached two patches to demonstrate the changes, in case you're interested. performancediff.patch reverses the preformance boost when applied to the latest checkout from svn by installing into the default schema and not setting the defaultSchemaName option. performancediff3.patch recovers the performance boost by simply setting defaultSchemaName to tckuser, the user name and default schema name. (Revert maven.xml first if you apply them in sequence.)

-- Michelle

Michael Watzek wrote:

Hi Michelle,

Afterwards I ran "maven runtck.jdori". This runs 2 configurations - one for the completeness and one for all test cases. As a result, 4 log files are written to target/logs - 2 for application identity, 2 for datastore identity. The all test TCK runs produced the expected amount of errors/failures - though, they did not take as much time as expected. Both runs perform about 7-8 times faster on my system - that's great :-)! What have you changed?




Wow, that IS great! It seemed a lot faster on my system too, but I wasn't paying much attention to performance. I have no idea what the difference is :-\ I will try to investigate before I check in.


I'm also curious about the performance boost, so I spent some time in investigating - without success:

I only get the performance boost with your patch. A clean workspace without your patch performs 7-8 times slower. I applied two changes of your patch to a clean workspace just to see if this makes a difference:

jdori.properties:
-org.jpox.validateTables=false  # default = true
+org.jpox.validateTables=false

logging.properties:
-log4j.category.JPOX.General=INFO, A1
+log4j.category.JPOX.General=DEBUG, A1

Both changes do not give better performance. So, I ran out of ideas. Hopefully, you have more luck in investigation.

- Can we include the configuration name and the identity type in the log file name? Currently, it's hard to find the right file if you are interested in only one file.




This is a good idea. I definitely would like to get more information into the log file or file name. Can you tell me where the log file name is created?


Class "BatchTestRunner" has a static inner class "ConsoleFileOutput" defining a static String "fileNamePrefix":

private static String fileNamePrefix = "TCKLog-";

I suggest to append the value of a system property which contains the configuration name and the identity type.

Regards,
Michael




------------------------------------------------------------------------

Index: test/sql/derby/datastoreidentity/schema.sql
===================================================================
--- test/sql/derby/datastoreidentity/schema.sql (revision 198769)
+++ test/sql/derby/datastoreidentity/schema.sql (working copy)
@@ -2,8 +2,8 @@
connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; -CREATE SCHEMA datastoreidentity0;
-SET SCHEMA datastoreidentity0;
+--CREATE SCHEMA datastoreidentity0;
+--SET SCHEMA datastoreidentity0;
-------------------------
 -- mylib
Index: test/sql/derby/applicationidentity/schema.sql
===================================================================
--- test/sql/derby/applicationidentity/schema.sql       (revision 198769)
+++ test/sql/derby/applicationidentity/schema.sql       (working copy)
@@ -2,8 +2,8 @@
connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; -CREATE SCHEMA applicationidentity0;
-SET SCHEMA applicationidentity0;
+--CREATE SCHEMA applicationidentity0;
+--SET SCHEMA applicationidentity0;
-------------------------
 -- mylib
Index: maven.xml
===================================================================
--- maven.xml   (revision 198769)
+++ maven.xml   (working copy)
@@ -269,8 +269,10 @@
                          value="${jdo.tck.excludelist}"/>
             <sysproperty key="javax.jdo.option.Mapping"
                          value="${jdo.tck.Mapping}"/>
+<!--
             <sysproperty key="org.jpox.identifier.defaultSchemaName"
                          value="${schemaname}"/>
+-->
             <jvmarg line="${database.runtck.sysproperties}"/>
             <jvmarg line="${jdo.runtck.sysproperties}"/>
             <arg line="${jdo.tck.classes}"/>


------------------------------------------------------------------------

Index: test/sql/derby/datastoreidentity/schema.sql
===================================================================
--- test/sql/derby/datastoreidentity/schema.sql (revision 198769)
+++ test/sql/derby/datastoreidentity/schema.sql (working copy)
@@ -2,8 +2,8 @@
connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; -CREATE SCHEMA datastoreidentity0;
-SET SCHEMA datastoreidentity0;
+--CREATE SCHEMA datastoreidentity0;
+--SET SCHEMA datastoreidentity0;
-------------------------
 -- mylib
Index: test/sql/derby/applicationidentity/schema.sql
===================================================================
--- test/sql/derby/applicationidentity/schema.sql       (revision 198769)
+++ test/sql/derby/applicationidentity/schema.sql       (working copy)
@@ -2,8 +2,8 @@
connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; -CREATE SCHEMA applicationidentity0;
-SET SCHEMA applicationidentity0;
+--CREATE SCHEMA applicationidentity0;
+--SET SCHEMA applicationidentity0;
-------------------------
 -- mylib
Index: maven.xml
===================================================================
--- maven.xml   (revision 198769)
+++ maven.xml   (working copy)
@@ -192,6 +192,8 @@
                         <j:expr value="${schemaname.concat(id)}"/>
                         <j:expr value="${schemaname.concat(mapping)}"/>
                     </j:set>
+                    <j:set var="schemaname" value="tckuser"/>
+                    <echo> Schemaname is ${schemaname} </echo>
                     <attainGoal name="doRuntck.jdori"/>
                 </j:forEach>
             </j:forEach>


--
-------------------------------------------------------------------
Michael Watzek                  [EMAIL PROTECTED] Engineering GmbH
mailto:[EMAIL PROTECTED]        Buelowstr. 66
Tel.:  ++49/30/235 520 36       10783 Berlin - Germany
Fax.:  ++49/30/217 520 12       http://www.spree.de/
-------------------------------------------------------------------

Reply via email to