Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / MyDerby-10.3 / java / engine / org / apache / derby / iapi / sql / execute / RunTimeStatistics.java
diff --git a/JMCR-Stable/real-world application/MyDerby-10.3/java/engine/org/apache/derby/iapi/sql/execute/RunTimeStatistics.java b/JMCR-Stable/real-world application/MyDerby-10.3/java/engine/org/apache/derby/iapi/sql/execute/RunTimeStatistics.java
new file mode 100644 (file)
index 0000000..c2ad8f1
--- /dev/null
@@ -0,0 +1,206 @@
+/*\r
+\r
+   Derby - Class org.apache.derby.iapi.sql.execute.RunTimeStatistics\r
+\r
+   Licensed to the Apache Software Foundation (ASF) under one or more\r
+   contributor license agreements.  See the NOTICE file distributed with\r
+   this work for additional information regarding copyright ownership.\r
+   The ASF licenses this file to you under the Apache License, Version 2.0\r
+   (the "License"); you may not use this file except in compliance with\r
+   the License.  You may obtain a copy of the License at\r
+\r
+      http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.iapi.sql.execute;\r
+\r
+import java.io.Serializable;\r
+\r
+import java.sql.Time;\r
+import java.sql.Timestamp;\r
+\r
+/**\r
+       \r
+  * A RunTimeStatistics object is a representation of the query execution plan and run\r
+  * time statistics for a java.sql.ResultSet.\r
+  * \r
+  * A query execution plan is a tree\r
+  * of execution nodes.  There are a number of possible node types.  Statistics \r
+  * are accumulated during execution at each node.  The types of statistics include\r
+  * the amount of time spent in specific operations (if STATISTICS TIMING is SET ON),\r
+  * the number of rows passed to the node by its child(ren) and the number of rows\r
+  * returned by the node to its parent.  (The exact statistics are specific to each\r
+  * node type.)\r
+  * <P>\r
+  * RunTimeStatistics is most meaningful for DML statements (SELECT, INSERT, DELETE\r
+  * and UPDATE).\r
+  *\r
+  */\r
+public interface RunTimeStatistics\r
+{\r
+       /**\r
+        * Get the total compile time for the associated query in milliseconds.\r
+        * Compile time can be divided into parse, bind, optimize and generate times.\r
+        * <P>\r
+        * 0 is returned if STATISTICS TIMING is not SET ON.\r
+        * \r
+        * @return      The total compile time for the associated query in milliseconds.\r
+        */\r
+       public long getCompileTimeInMillis();\r
+\r
+       /**\r
+        * Get the parse time for the associated query in milliseconds.\r
+        * <P>\r
+        * 0 is returned if STATISTICS TIMING is not SET ON.\r
+        * \r
+        * @return      The parse time for the associated query in milliseconds.\r
+        */\r
+       public long getParseTimeInMillis();\r
+\r
+       /**\r
+        * Get the bind time for the associated query in milliseconds.\r
+        * \r
+        * @return      The bind time for the associated query in milliseconds.\r
+        */\r
+       public long getBindTimeInMillis();\r
+\r
+       /**\r
+        * Get the optimize time for the associated query in milliseconds.\r
+        * <P>\r
+        * 0 is returned if STATISTICS TIMING is not SET ON.\r
+        * \r
+        * @return      The optimize time for the associated query in milliseconds.\r
+        */\r
+       public long getOptimizeTimeInMillis();\r
+\r
+       /**\r
+        * Get the generate time for the associated query in milliseconds.\r
+        * <P>\r
+        * 0 is returned if STATISTICS TIMING is not SET ON.\r
+        * \r
+        * @return      The generate time for the associated query in milliseconds.\r
+        */\r
+       public long getGenerateTimeInMillis();\r
+\r
+       /**\r
+        * Get the execute time for the associated query in milliseconds.\r
+        * <P>\r
+        * 0 is returned if STATISTICS TIMING is not SET ON.\r
+        * \r
+        * @return      The execute time for the associated query in milliseconds.\r
+        */\r
+       public long getExecuteTimeInMillis();\r
+\r
+       /**\r
+        * Get the timestamp for the beginning of query compilation. \r
+        * <P>\r
+        * A null is returned if STATISTICS TIMING is not SET ON.\r
+        *\r
+        * @return      The timestamp for the beginning of query compilation.\r
+        */\r
+       public Timestamp getBeginCompilationTimestamp(); \r
+\r
+       /**\r
+        * Get the timestamp for the end of query compilation. \r
+        * <P>\r
+        * A null is returned if STATISTICS TIMING is not SET ON.\r
+        *\r
+        * @return      The timestamp for the end of query compilation.\r
+        */\r
+       public Timestamp getEndCompilationTimestamp(); \r
+\r
+       /**\r
+        * Get the timestamp for the beginning of query execution. \r
+        * <P>\r
+        * A null is returned if STATISTICS TIMING is not SET ON.\r
+        *\r
+        * @return      The timestamp for the beginning of query execution.\r
+        */\r
+       public Timestamp getBeginExecutionTimestamp(); \r
+\r
+       /**\r
+        * Get the timestamp for the end of query execution. \r
+        * <P>\r
+        * A null is returned if STATISTICS TIMING is not SET ON.\r
+        *\r
+        * @return      The timestamp for the end of query execution.\r
+        */\r
+       public Timestamp getEndExecutionTimestamp(); \r
+\r
+       /**\r
+        * Get the name of the associated query or statement.\r
+        * (This will be an internally generated name if the\r
+        * user did not assign a name.)\r
+        *\r
+        * @return      The name of the associated query or statement.\r
+        */\r
+       public String getStatementName();\r
+\r
+       /**\r
+        * Get the name of the Stored Prepared Statement used\r
+        * for the statement.  This method returns\r
+        * a value only for <i>EXECUTE STATEMENT</i> statements;\r
+        * otherwise, returns null.\r
+        * <p>\r
+        * Note that the name is returned in the schema.name\r
+        * format (e.g. APP.MYSTMT).\r
+        *\r
+        * @return      The Stored Prepared Statement name of \r
+        * the associated statement, or null if it is not an EXECUTE \r
+        * STATEMENT statement.\r
+        */\r
+       public String getSPSName();\r
+\r
+       /**\r
+        * Get the text for the associated query or statement.\r
+        *\r
+        * @return      The text for the associated query or statement.\r
+        */\r
+       public String getStatementText();\r
+\r
+       /**\r
+        * Get a String representation of the execution plan \r
+        * for the associated query or statement.\r
+        *\r
+        * @return      The execution plan for the associated query or statement.\r
+        */\r
+       public String getStatementExecutionPlanText();\r
+\r
+       /**\r
+        * Get a String representation of the information on the nodes \r
+        * relating to table and index scans from the execution plan for \r
+        * the associated query or statement.\r
+        *\r
+        * @return      The nodes relating to table and index scans\r
+        * from the execution plan for the associated query or statement.\r
+        */\r
+       public String getScanStatisticsText();\r
+\r
+       /**\r
+        * Get a String representation of the information on the nodes \r
+        * relating to table and index scans from the execution plan for \r
+        * the associated query or statement for a particular table.\r
+        * <P>\r
+        * @param   tableName The table for which user desires statistics.\r
+        * <P>\r
+        * @return      The nodes relating to table and index scans\r
+        * from the execution plan for the associated query or statement.\r
+        */\r
+       public String getScanStatisticsText(String tableName);\r
+\r
+       /**\r
+        * Get the estimated row count for the number of rows returned\r
+        * by the associated query or statement.\r
+        *\r
+        * @return      The estimated number of rows returned by the associated\r
+        * query or statement.\r
+        */\r
+       public double getEstimatedRowCount();\r
+}\r