01: /*
02:
03: Derby - Class org.apache.derby.iapi.sql.compile.OptimizerFactory
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to you under the Apache License, Version 2.0
09: (the "License"); you may not use this file except in compliance with
10: the License. You may obtain a copy of the License at
11:
12: http://www.apache.org/licenses/LICENSE-2.0
13:
14: Unless required by applicable law or agreed to in writing, software
15: distributed under the License is distributed on an "AS IS" BASIS,
16: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: See the License for the specific language governing permissions and
18: limitations under the License.
19:
20: */
21:
22: package org.apache.derby.iapi.sql.compile;
23:
24: import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
25:
26: import org.apache.derby.iapi.sql.dictionary.DataDictionary;
27: import org.apache.derby.iapi.store.access.TransactionController;
28: import org.apache.derby.iapi.services.context.ContextManager;
29:
30: import org.apache.derby.iapi.error.StandardException;
31:
32: /**
33: This is simply the factory for creating an optimizer.
34: <p>
35: There is expected to be only one of these configured per database.
36: */
37:
38: public interface OptimizerFactory {
39: /**
40: Module name for the monitor's module locating system.
41: */
42: String MODULE = "org.apache.derby.iapi.sql.compile.OptimizerFactory";
43:
44: /**
45: * Only one optimizer level should exist in the database, however, the
46: * connection may have multiple instances of that optimizer
47: * at a given time.
48: *
49: * @param optimizableList The list of Optimizables to optimize.
50: * @param predicateList The list of unassigned OptimizablePredicates.
51: * @param dDictionary The DataDictionary to use.
52: * @param requiredRowOrdering The required ordering of the rows to
53: * come out of the optimized result set
54: * @param numTablesInQuery The number of tables in the current query
55: * @param lcc The LanguageConnectionContext
56: *
57: * RESOLVE - We probably want to pass a subquery list, once we define a
58: * new interface for them, so that the Optimizer can out where to attach
59: * the subqueries.
60: *
61: * @exception StandardException Thrown on error
62: */
63: public Optimizer getOptimizer(OptimizableList optimizableList,
64: OptimizablePredicateList predicateList,
65: DataDictionary dDictionary,
66: RequiredRowOrdering requiredRowOrdering,
67: int numTablesInQuery, LanguageConnectionContext lcc)
68: throws StandardException;
69:
70: /**
71: * Return a new CostEstimate.
72: *
73: * @exception StandardException Thrown on error
74: */
75: public CostEstimate getCostEstimate() throws StandardException;
76:
77: /**
78: * Return whether or not the optimizer associated with
79: * this factory supports optimizer trace.
80: *
81: * @return Whether or not the optimizer associated with
82: * this factory supports optimizer trace.
83: */
84: public boolean supportsOptimizerTrace();
85:
86: /**
87: * Return the maxMemoryPerTable setting, this is used in
88: * optimizer, as well as subquery materialization at run time.
89: *
90: * @return maxMemoryPerTable value
91: */
92: public int getMaxMemoryPerTable();
93: }
|