Author: pnedonosko
Date: 2009-11-18 09:15:30 -0500 (Wed, 18 Nov 2009)
New Revision: 752
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
Log:
EXOJCR-248: get childs optimization (HSQLDB tunning)
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-18
14:10:55 UTC (rev 751)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-18
14:15:30 UTC (rev 752)
@@ -2204,10 +2204,10 @@
// JBC related
- protected abstract ResultSet findChildPropertiesIdNameByParentIdentifier(String
parentIdentifier)
+ protected abstract ResultSet findChildPropertiesIdNameByParentIdentifier(String
parentCid)
throws SQLException;
- protected abstract ResultSet findChildNodesNameByParentIdentifier(String
parentIdentifier) throws SQLException;
+ protected abstract ResultSet findChildNodesNameByParentIdentifier(String parentCid)
throws SQLException;
protected abstract ResultSet findItemIdentifier(String parentCid, String name) throws
SQLException;
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java 2009-11-18
14:10:55 UTC (rev 751)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java 2009-11-18
14:15:30 UTC (rev 752)
@@ -74,6 +74,9 @@
"select V.DATA" + " from JCR_MITEM I, JCR_MVALUE V"
+ " where I.PARENT_ID=? and I.I_CLASS=2 and I.NAME=? and
I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
FIND_NODES_BY_PARENTID = "select * from JCR_MITEM" + " where
PARENT_ID=? and I_CLASS=1" + " order by N_ORDER_NUM";
+
+ FIND_NODES_NAME_BY_PARENTID = "select NAME from JCR_MITEM" + " where
PARENT_ID=? and I_CLASS=1" + " order by N_ORDER_NUM";
+
FIND_PROPERTIES_BY_PARENTID = "select * from JCR_MITEM" + " where
PARENT_ID=? and I_CLASS=2" + " order by ID";
}
}
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2009-11-18
14:10:55 UTC (rev 751)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2009-11-18
14:15:30 UTC (rev 752)
@@ -81,6 +81,10 @@
+ " where I.PARENT_ID=? and I.I_CLASS=2 and I.CONTAINER_NAME=? and
I.NAME=? and I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
FIND_NODES_BY_PARENTID =
"select * from JCR_SITEM" + " where PARENT_ID=? and I_CLASS=1 and
CONTAINER_NAME=?" + " order by N_ORDER_NUM";
+
+ FIND_NODES_NAME_BY_PARENTID =
+ "select NAME from JCR_SITEM" + " where PARENT_ID=? and I_CLASS=1
and CONTAINER_NAME=?" + " order by N_ORDER_NUM";
+
FIND_PROPERTIES_BY_PARENTID =
"select * from JCR_SITEM" + " where PARENT_ID=? and I_CLASS=2 and
CONTAINER_NAME=?" + " order by ID";
FIND_PROPERTIES_IDNAME_BY_PARENTID =
@@ -169,4 +173,23 @@
findPropertiesIdNameByParentId.setString(2, containerName);
return findPropertiesIdNameByParentId.executeQuery();
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ResultSet findChildNodesNameByParentIdentifier(String parentCid) throws
SQLException
+ {
+ if (findNodesNameByParentId == null)
+ {
+ findNodesNameByParentId =
dbConnection.prepareStatement(FIND_NODES_NAME_BY_PARENTID);
+ }
+ else
+ {
+ findNodesNameByParentId.clearParameters();
+ }
+ findNodesNameByParentId.setString(1, parentCid);
+ findNodesNameByParentId.setString(2, containerName);
+ return findNodesNameByParentId.executeQuery();
+ }
}
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-18
14:10:55 UTC (rev 751)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-18
14:15:30 UTC (rev 752)
@@ -633,7 +633,7 @@
* {@inheritDoc}
*/
@Override
- protected ResultSet findChildNodesNameByParentIdentifier(String parentIdentifier)
throws SQLException
+ protected ResultSet findChildNodesNameByParentIdentifier(String parentCid) throws
SQLException
{
if (findNodesNameByParentId == null)
{
@@ -643,7 +643,8 @@
{
findNodesNameByParentId.clearParameters();
}
- findNodesNameByParentId.setString(1, parentIdentifier);
+ findNodesNameByParentId.setString(1, containerName);
+ findNodesNameByParentId.setString(2, parentCid);
return findNodesNameByParentId.executeQuery();
}
}
Show replies by date