001: /*
002:
003: Derby - Class org.apache.derby.impl.sql.compile.Level2OptimizerFactoryImpl
004:
005: Licensed to the Apache Software Foundation (ASF) under one or more
006: contributor license agreements. See the NOTICE file distributed with
007: this work for additional information regarding copyright ownership.
008: The ASF licenses this file to you under the Apache License, Version 2.0
009: (the "License"); you may not use this file except in compliance with
010: the License. You may obtain a copy of the License at
011:
012: http://www.apache.org/licenses/LICENSE-2.0
013:
014: Unless required by applicable law or agreed to in writing, software
015: distributed under the License is distributed on an "AS IS" BASIS,
016: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: See the License for the specific language governing permissions and
018: limitations under the License.
019:
020: */
021:
022: package org.apache.derby.impl.sql.compile;
023:
024: import org.apache.derby.iapi.sql.compile.CostEstimate;
025: import org.apache.derby.iapi.sql.compile.JoinStrategy;
026: import org.apache.derby.iapi.sql.compile.OptimizableList;
027: import org.apache.derby.iapi.sql.compile.OptimizablePredicateList;
028: import org.apache.derby.iapi.sql.compile.Optimizer;
029: import org.apache.derby.iapi.sql.compile.OptimizerFactory;
030: import org.apache.derby.iapi.sql.compile.RequiredRowOrdering;
031:
032: import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
033:
034: import org.apache.derby.iapi.store.access.TransactionController;
035:
036: import org.apache.derby.iapi.sql.dictionary.DataDictionary;
037:
038: import org.apache.derby.iapi.services.monitor.ModuleControl;
039: import org.apache.derby.iapi.services.context.ContextManager;
040: import org.apache.derby.iapi.services.property.PropertyUtil;
041:
042: import org.apache.derby.iapi.services.sanity.SanityManager;
043:
044: import org.apache.derby.iapi.error.StandardException;
045:
046: import org.apache.derby.iapi.reference.Property;
047:
048: import org.apache.derby.impl.sql.compile.OptimizerFactoryImpl;
049:
050: import java.util.Properties;
051:
052: /**
053: This is simply the factory for creating an optimizer.
054: */
055:
056: public class Level2OptimizerFactoryImpl extends OptimizerFactoryImpl {
057:
058: //
059: // ModuleControl interface
060: //
061:
062: public void boot(boolean create, Properties startParams)
063: throws StandardException {
064: super .boot(create, startParams);
065: }
066:
067: //
068: // OptimizerFactory interface
069: //
070:
071: /**
072: * @see OptimizerFactory#supportsOptimizerTrace
073: */
074: public boolean supportsOptimizerTrace() {
075: return true;
076: }
077:
078: //
079: // class interface
080: //
081: public Level2OptimizerFactoryImpl() {
082: }
083:
084: protected Optimizer getOptimizerImpl(
085: OptimizableList optimizableList,
086: OptimizablePredicateList predList,
087: DataDictionary dDictionary,
088: RequiredRowOrdering requiredRowOrdering,
089: int numTablesInQuery, LanguageConnectionContext lcc)
090: throws StandardException {
091:
092: return new Level2OptimizerImpl(optimizableList, predList,
093: dDictionary, ruleBasedOptimization, noTimeout,
094: useStatistics, maxMemoryPerTable, joinStrategySet, lcc
095: .getLockEscalationThreshold(),
096: requiredRowOrdering, numTablesInQuery, lcc);
097: }
098:
099: /**
100: * @see OptimizerFactory#getCostEstimate
101: *
102: * @exception StandardException Thrown on error
103: */
104: public CostEstimate getCostEstimate() throws StandardException {
105: return new Level2CostEstimateImpl();
106: }
107: }
|