KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > sql > compile > OptimizerFactory


1 /*
2
3    Derby - Class org.apache.derby.iapi.sql.compile.OptimizerFactory
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (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 JavaDoc 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,
68                                   LanguageConnectionContext lcc)
69             throws StandardException;
70
71
72     /**
73      * Return a new CostEstimate.
74      *
75      * @exception StandardException Thrown on error
76      */

77     public CostEstimate getCostEstimate()
78         throws StandardException;
79
80     /**
81      * Return whether or not the optimizer associated with
82      * this factory supports optimizer trace.
83      *
84      * @return Whether or not the optimizer associated with
85      * this factory supports optimizer trace.
86      */

87     public boolean supportsOptimizerTrace();
88
89     /**
90      * Return the maxMemoryPerTable setting, this is used in
91      * optimizer, as well as subquery materialization at run time.
92      *
93      * @return maxMemoryPerTable value
94      */

95     public int getMaxMemoryPerTable();
96 }
97
Popular Tags