incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1189426 - /incubator/lcf/branches/CONNECTORS-284/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
Date Wed, 26 Oct 2011 20:22:44 GMT
Author: kwright
Date: Wed Oct 26 20:22:44 2011
New Revision: 1189426

URL: http://svn.apache.org/viewvc?rev=1189426&view=rev
Log:
Hook up plan output on long-running queries

Modified:
    incubator/lcf/branches/CONNECTORS-284/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java

Modified: incubator/lcf/branches/CONNECTORS-284/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-284/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java?rev=1189426&r1=1189425&r2=1189426&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-284/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
(original)
+++ incubator/lcf/branches/CONNECTORS-284/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
Wed Oct 26 20:22:44 2011
@@ -1184,7 +1184,24 @@ public class DBInterfaceHSQLDB extends D
     else
       throw new ManifoldCFException("Transaction nesting error!");
   }
-  
+
+  /** Abstract method for explaining a query */
+  protected void explainQuery(String query, List params)
+    throws ManifoldCFException
+  {
+    IResultSet x = executeUncachedQuery("EXPLAIN PLAN FOR "+query,null,true,
+      -1,null,null);
+    int k = 0;
+    while (k < x.getRowCount())
+    {
+      IResultRow row = x.getRow(k++);
+      Iterator<String> iter = row.getColumns();
+      String colName = (String)iter.next();
+      Logging.db.warn(" Plan: "+row.getValue(colName).toString());
+    }
+    Logging.db.warn("");
+  }
+
   /** Abstract method for mapping a column name from resultset */
   protected String mapColumnName(String rawColumnName)
   {



Mime
View raw message