/*
Derby - Class org.apache.derby.impl.sql.execute.xplain.XPLAINSystemTableVisitor
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.apache.derby.impl.sql.execute.xplain;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Stack;
import org.apache.derby.catalog.UUID;
import org.apache.derby.iapi.jdbc.ConnectionContext;
import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.services.info.JVMInfo;
import org.apache.derby.iapi.sql.Activation;
import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
import org.apache.derby.iapi.sql.dictionary.DataDictionary;
import org.apache.derby.impl.sql.catalog.XPLAINResultSetDescriptor;
import org.apache.derby.impl.sql.catalog.XPLAINResultSetTimingsDescriptor;
import org.apache.derby.impl.sql.catalog.XPLAINScanPropsDescriptor;
import org.apache.derby.impl.sql.catalog.XPLAINSortPropsDescriptor;
import org.apache.derby.impl.sql.catalog.XPLAINStatementDescriptor;
import org.apache.derby.impl.sql.catalog.XPLAINStatementTimingsDescriptor;
import org.apache.derby.iapi.sql.execute.RunTimeStatistics;
import org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor;
import org.apache.derby.iapi.sql.execute.ResultSetStatistics;
/**
* This is the Visitor, which explains the information and stores the statistics in
* the system catalogs. It traverses the result set statistics tree and extracts the
* information.
*
*/
public class XPLAINSystemTableVisitor implements XPLAINVisitor {
private boolean no_call_stmts = true;
// ---------------------------------------------------------
// member variables
// ---------------------------------------------------------
// the needed system objects for writing to the dictionary
private LanguageConnectionContext lcc;
private DataDictionary dd;
// the stmt activation object
private Activation activation;
// a flag which is used to reflect if the statistics timings is on
private boolean considerTimingInformation = false;
// the different tuple descriptors describing the query characteristics
// regarding the stmt
private XPLAINStatementDescriptor stmt;
private XPLAINStatementTimingsDescriptor stmtTimings = null;
private UUID stmtUUID; // the UUID to save for the resultsets
// now the lists of descriptors regarding the resultsets
private List rsets; // for the resultset descriptors
private List
Ads help maintain this website.