Merge lp:~mmcm/akiban-server/group-lookup into lp:~akiban-technologies/akiban-server/trunk

Proposed by Mike McMahon
Status: Merged
Approved by: Nathan Williams
Approved revision: 2733
Merged at revision: 2712
Proposed branch: lp:~mmcm/akiban-server/group-lookup
Merge into: lp:~akiban-technologies/akiban-server/trunk
Diff against target: 3920 lines (+1110/-1031)
119 files modified
src/main/java/com/akiban/qp/operator/API.java (+16/-37)
src/main/java/com/akiban/qp/operator/AncestorLookup_Nested.java (+4/-4)
src/main/java/com/akiban/qp/operator/GroupLookup_Default.java (+345/-157)
src/main/java/com/akiban/qp/operator/IndexScan_Default.java (+1/-0)
src/main/java/com/akiban/qp/persistitadapter/OperatorBasedRowCollector.java (+13/-15)
src/main/java/com/akiban/server/service/restdml/ModelBuilder.java (+3/-2)
src/main/java/com/akiban/server/service/text/FullTextIndexInfo.java (+6/-5)
src/main/java/com/akiban/server/store/StoreGIMaintenance.java (+12/-11)
src/main/java/com/akiban/sql/optimizer/rule/OperatorAssembler.java (+41/-16)
src/main/java/com/akiban/sql/optimizer/rule/PlanGenerator.java (+12/-6)
src/test/java/com/akiban/server/service/restdml/DeleteGeneratorIT.java (+4/-4)
src/test/java/com/akiban/server/test/it/qp/BranchLookup_DefaultIT.java (+0/-536)
src/test/java/com/akiban/server/test/it/qp/GroupLookup_DefaultIT.java (+510/-42)
src/test/java/com/akiban/server/test/it/qp/GroupLookup_DefaultLookaheadIT.java (+17/-68)
src/test/resources/com/akiban/sql/optimizer/operator/cbo/duplicate-child.expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-multi-branch.expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-multi-duplicate.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-multi-ordered.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-single-branch.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-1.expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-1.t3expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-2.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-2.t3expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/cbo/subquery-join-1.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/cbo/subquery-join-1.t3expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/cbo/subquery-join-2.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/cbo/three-groups.expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/count-3.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/count-3.t3expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/delete-1.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-0.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02a.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02b.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02p.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02r.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-07o.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-10.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-11.expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-11.t3expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-14.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-15.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-15a.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-15i.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-2.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-3.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-4.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-5.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-6.expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-9.expected (+2/-3)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-1.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-3.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-4.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-5.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-6.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-7.expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02bt.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02eq.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02ge.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02le.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02lt.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02r.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-03l.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-03m.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-07o.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-07oo.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-07ooo.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-1.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-13.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-14.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-14p.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-14u.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-15d.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-17a.expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-17b.expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-17bu.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-2.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-20.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-20.t3expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-3.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-1.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-1v.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-2.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-2n.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-2v.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-3.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-join.expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/operator/coia/select-1.expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/operator/coia/select-2.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia/select-3.expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/operator/coia/select-4.expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/operator/coia/select-5.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia/select-6.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/coia/select-7.expected (+2/-3)
src/test/resources/com/akiban/sql/optimizer/operator/histograms/select-1.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/operator/histograms/select-2.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02n.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02n.t3expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02s.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02s.t3expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-1.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-2.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-2.t3expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/full-text-1.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/full-text-2.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-1.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-2.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-2.t3expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-5.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-5.t3expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10.expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10.t3expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10n.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10n.t3expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/select-2.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/select-3.expected (+2/-2)
src/test/resources/com/akiban/sql/optimizer/rule/operator/select-5.expected (+1/-1)
src/test/resources/com/akiban/sql/optimizer/rule/operator/update-1.expected (+1/-1)
src/test/resources/com/akiban/sql/pg/select/explain-2.expected (+1/-1)
src/test/resources/com/akiban/sql/pg/yaml/functional/test-statement-cache.yaml (+2/-2)
To merge this branch: bzr merge lp:~mmcm/akiban-server/group-lookup
Reviewer Review Type Date Requested Status
Nathan Williams Approve
Review via email: mp+176556@code.launchpad.net

Description of the change

Combine AncestorLookup_Default and BranchLookup_Default into a single GroupLookup_Default.

The Branch API is somewhat simplified: the combined one is what Ancestor had, namely, an input row type and a collection of output row types. The operator can return any combination of rows that are ancestors or descendants of the input row. Unlike BranchLookup_Default, it does not allow other rows in the same group. While this would be a straightforward extension for the case of items for the given address, it gets messy for sibling orders. So, for both those cases, two occurrences of GroupLookup_Default will be used: one to navigate to the appropriate ancestor (thereby disambiguating various possibilities) and another to get children from that.

The output is filtered by the given row types, even for the branch cases. Someday this filtering might be passed into the storage layer.

A further optimization is that when all descendants are on the same branch, the ordinal of that branchpoint can be added to the lookup hkey, saving having to ignore rows from other branches.

The addition (relative to AncestorLookup) for the pipeline case is actually much more straightforward than for the non-pipeline (usually simpler) case. That is because it's just one more cursor, opened and read at the same time, with just a slightly different rebind hkey and row limit semantics. Whereas doing it in stages means rather more state.

All tests pass locally. I am not 100% confident that everything affected is being tested. For instance, newRowCollector. Any suggestions for what I might have missed would be welcome.

To post a comment you must log in.
lp:~mmcm/akiban-server/group-lookup updated
2732. By Mike McMahon

Missed some log messages.

2733. By Mike McMahon

Include state in explainer.

Revision history for this message
Nathan Williams (nwilliams) wrote :

There's quite a bit here but it looks as expected.

Jenkins will surely tell us if newRowCollector is broken.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/main/java/com/akiban/qp/operator/API.java'
--- src/main/java/com/akiban/qp/operator/API.java 2013-07-19 14:44:52 +0000
+++ src/main/java/com/akiban/qp/operator/API.java 2013-07-24 22:52:24 +0000
@@ -25,6 +25,7 @@
25import com.akiban.qp.row.RowBase;25import com.akiban.qp.row.RowBase;
26import com.akiban.qp.rowtype.IndexRowType;26import com.akiban.qp.rowtype.IndexRowType;
27import com.akiban.qp.rowtype.RowType;27import com.akiban.qp.rowtype.RowType;
28import com.akiban.qp.rowtype.Schema;
28import com.akiban.qp.rowtype.UserTableRowType;29import com.akiban.qp.rowtype.UserTableRowType;
29import com.akiban.server.aggregation.AggregatorRegistry;30import com.akiban.server.aggregation.AggregatorRegistry;
30import com.akiban.server.aggregation.Aggregators;31import com.akiban.server.aggregation.Aggregators;
@@ -189,17 +190,13 @@
189 UserTableRowType outputRowType,190 UserTableRowType outputRowType,
190 InputPreservationOption flag)191 InputPreservationOption flag)
191 {192 {
192 return branchLookup_Default(inputOperator, group, inputRowType, outputRowType, flag, NO_LIMIT);193 List<UserTableRowType> outputRowTypes = new ArrayList<>();
193 }194 outputRowTypes.add(outputRowType);
194195 Schema schema = (Schema)outputRowType.schema();
195 public static Operator branchLookup_Default(Operator inputOperator,196 for (RowType rowType : schema.descendentTypes(outputRowType, schema.userTableTypes())) {
196 Group group,197 outputRowTypes.add((UserTableRowType)rowType);
197 RowType inputRowType,198 }
198 UserTableRowType outputRowType,199 return groupLookup_Default(inputOperator, group, inputRowType, outputRowTypes, flag, 1);
199 InputPreservationOption flag,
200 Limit limit)
201 {
202 return new BranchLookup_Default(inputOperator, group, inputRowType, outputRowType, flag, limit);
203 }200 }
204201
205 /** deprecated */202 /** deprecated */
@@ -275,17 +272,17 @@
275 Collection<UserTableRowType> ancestorTypes,272 Collection<UserTableRowType> ancestorTypes,
276 InputPreservationOption flag)273 InputPreservationOption flag)
277 {274 {
278 return ancestorLookup_Default(inputOperator, group, rowType, ancestorTypes, flag, 1);275 return groupLookup_Default(inputOperator, group, rowType, ancestorTypes, flag, 1);
279 }276 }
280277
281 public static Operator ancestorLookup_Default(Operator inputOperator,278 public static Operator groupLookup_Default(Operator inputOperator,
282 Group group,279 Group group,
283 RowType rowType,280 RowType rowType,
284 Collection<UserTableRowType> ancestorTypes,281 Collection<UserTableRowType> ancestorTypes,
285 InputPreservationOption flag,282 InputPreservationOption flag,
286 int lookaheadQuantum)283 int lookaheadQuantum)
287 {284 {
288 return new AncestorLookup_Default(inputOperator, group, rowType, ancestorTypes, flag, lookaheadQuantum);285 return new GroupLookup_Default(inputOperator, group, rowType, ancestorTypes, flag, lookaheadQuantum);
289 }286 }
290287
291 public static Operator ancestorLookup_Nested(Group group,288 public static Operator ancestorLookup_Nested(Group group,
@@ -981,22 +978,4 @@
981 private final List<AkCollator> collators = new ArrayList<>();978 private final List<AkCollator> collators = new ArrayList<>();
982 }979 }
983980
984 // Class state
985
986 private static final Limit NO_LIMIT = new Limit()
987 {
988
989 @Override
990 public boolean limitReached(RowBase row)
991 {
992 return false;
993 }
994
995 @Override
996 public String toString()
997 {
998 return "NO LIMIT";
999 }
1000
1001 };
1002}981}
1003982
=== modified file 'src/main/java/com/akiban/qp/operator/AncestorLookup_Nested.java'
--- src/main/java/com/akiban/qp/operator/AncestorLookup_Nested.java 2013-07-17 18:15:10 +0000
+++ src/main/java/com/akiban/qp/operator/AncestorLookup_Nested.java 2013-07-24 22:52:24 +0000
@@ -44,13 +44,13 @@
4444
45 One expected usage is to locate the group row corresponding to an45 One expected usage is to locate the group row corresponding to an
46 index row. For example, an index on customer.name yields index rows46 index row. For example, an index on customer.name yields index rows
47 which AncestorLookup_Default can then use to locate customer47 which AncestorLookup_Nested can then use to locate customer
48 rows. (The ancestor relationship is reflexive, e.g. customer is48 rows. (The ancestor relationship is reflexive, e.g. customer is
49 considered to be an ancestor of customer.)49 considered to be an ancestor of customer.)
5050
51 Another expected usage is to locate ancestors higher in the group. For51 Another expected usage is to locate ancestors higher in the group. For
52 example, given either an item row or an item index row,52 example, given either an item row or an item index row,
53 AncestorLookup_Default can be used to find the corresponding order and53 AncestorLookup_Nested can be used to find the corresponding order and
54 customer.54 customer.
5555
56 AncestorLookup_Nested always locates 0-1 row per ancestor type.56 AncestorLookup_Nested always locates 0-1 row per ancestor type.
@@ -101,12 +101,12 @@
101101
102 <h1>Performance</h1>102 <h1>Performance</h1>
103103
104 For each input row, AncestorLookup_Default does one random access for104 For each input row, AncestorLookup_Nested does one random access for
105 each ancestor type.105 each ancestor type.
106106
107 <h1>Memory Requirements</h1>107 <h1>Memory Requirements</h1>
108108
109 AncestorLookup_Default stores in memory up to (ancestorTypes.size() +109 AncestorLookup_Nested stores in memory up to (ancestorTypes.size() +
110 1) rows.110 1) rows.
111111
112 */112 */
113113
=== renamed file 'src/main/java/com/akiban/qp/operator/AncestorLookup_Default.java' => 'src/main/java/com/akiban/qp/operator/GroupLookup_Default.java'
--- src/main/java/com/akiban/qp/operator/AncestorLookup_Default.java 2013-07-15 22:01:49 +0000
+++ src/main/java/com/akiban/qp/operator/GroupLookup_Default.java 2013-07-24 22:52:24 +0000
@@ -35,63 +35,63 @@
35import org.slf4j.LoggerFactory;35import org.slf4j.LoggerFactory;
3636
37import java.util.*;37import java.util.*;
38import static java.lang.Math.min;
3839
39/**40/**
4041
41 <h1>Overview</h1>42 <h1>Overview</h1>
4243
43 AncestorLookup_Default locates ancestors of both group rows and index rows.44 GroupLookup_Default locates related group rows of both group rows and index rows.
4445
45 One expected usage is to locate the group row corresponding to an46 One expected usage is to locate the group row corresponding to an
46 index row. For example, an index on customer.name yields index rows47 index row. For example, an index on customer.name yields index rows
47 which AncestorLookup_Default can then use to locate customer48 which GroupLookup_Default can then use to locate customer
48 rows. (The ancestor relationship is reflexive, e.g. customer is49 rows.
49 considered to be an ancestor of customer.)
5050
51 Another expected usage is to locate ancestors higher in the group. For51 Another expected usage is to locate ancestors higher in the group. For
52 example, given either an item row or an item index row,52 example, given either an item row or an item index row,
53 AncestorLookup_Default can be used to find the corresponding order and53 GroupLookup_Default can be used to find the corresponding order and
54 customer.54 customer.
5555
56 Unlike BranchLookup, AncestorLookup always locates 0-1 row per ancestor type.56 Another expected usage is to locate descendants lower in the group. For
57 example, given either an order group row,
58 GroupLookup_Default can be used to find the corresponding items.
5759
58 <h1>Arguments</h1>60 <h1>Arguments</h1>
5961
60 <ul>62 <ul>
6163
62 <li><b>GroupTable groupTable:</b> The group table containing the64 <li><b>Group group:</b> The group containing the tables of interest.
63 ancestors of interest.
6465
65 <li><b>RowType rowType:</b> Ancestors will be located for input rows66 <li><b>RowType inputRowType:</b> Other tables will be located for input rows
66 of this type.67 of this type.
6768
68 <li><b>Collection<UserTableRowType> ancestorTypes:</b> Ancestor types to be located.69 <li><b>Collection<UserTableRowType> outputRowTypes:</b> Tables to be located.
6970
70 <li><b>API.InputPreservationOption flag:</b> Indicates whether rows of type rowType71 <li><b>API.InputPreservationOption flag:</b> Indicates whether rows of type rowType
71 will be preserved in the output stream (flag = KEEP_INPUT), or72 will be preserved in the output stream (flag = KEEP_INPUT), or
72 discarded (flag = DISCARD_INPUT).73 discarded (flag = DISCARD_INPUT).
7374
74 <li><b>int lookaheadQuantum:</b> Number of cursors to try to keep open by looking75 <li><b>int lookaheadQuantum:</b> Number of cursors to try to keep open by looking
75 ahead in input stream, possibly across multiple bindings.76 ahead in input stream, possibly across multiple outer loops.
7677
77 </ul>78 </ul>
7879
79 rowType may be an index row type or a group row type. For a group row80 rowType may be an index row type or a group row type. For an index row
80 type, rowType must not be one of the ancestorTypes. For an index row81 type, rowType may be one of the outputRowTypes, and keepInput must be
81 type, rowType may be one of the ancestorTypes, and keepInput must be82 false.
82 false (this may be relaxed in the future).
8383
84 The groupTable, rowType, and all ancestorTypes must belong to the same84 The group, inputRowType, and all outputRowTypes must belong to the same
85 group.85 group.
8686
87 Each ancestorType must be an ancestor of the rowType (or, if rowType87 Each outputRowType must be an ancestor of the rowType or a descendant of it.
88 is an index type, then an ancestor of the index's table's type).
8988
90 <h1>Behavior</h1>89 <h1>Behavior</h1>
9190
92 For each input row, the hkey is obtained. For each ancestor type, the91 For each input row, the hkey is obtained. For each ancestor type, the
93 hkey is shortened if necessary, and the groupTable is then search for92 hkey is shortened if necessary, and the groupTable is then searched for
94 a record with that exact hkey. All the retrieved records are written93 a record with that exact hkey. For each descendant type, the hkey is lengthened
94 with the ordinal of the shallowest descendant. All the retrieved records are written
95 to the output stream in hkey order (ancestors before descendents), as95 to the output stream in hkey order (ancestors before descendents), as
96 is the input row if keepInput is true.96 is the input row if keepInput is true.
9797
@@ -105,24 +105,24 @@
105105
106 <h1>Performance</h1>106 <h1>Performance</h1>
107107
108 For each input row, AncestorLookup_Default does one random access for108 For each input row, GroupLookup_Default does one random access for
109 each ancestor type.109 each ancestor type and one range access if there are any descendant types.
110110
111 <h1>Memory Requirements</h1>111 <h1>Memory Requirements</h1>
112112
113 AncestorLookup_Default stores in memory up to (ancestorTypes.size() +113 GroupLookup_Default stores in memory up to (number of ancestors +
114 1) rows.114 1) rows.
115115
116 */116 */
117117
118class AncestorLookup_Default extends Operator118class GroupLookup_Default extends Operator
119{119{
120 // Object interface120 // Object interface
121121
122 @Override122 @Override
123 public String toString()123 public String toString()
124 {124 {
125 return String.format("%s(%s -> %s)", getClass().getSimpleName(), rowType, ancestors);125 return String.format("%s(%s -> %s)", getClass().getSimpleName(), inputRowType, outputRowTypes());
126 }126 }
127127
128 // Operator interface128 // Operator interface
@@ -158,111 +158,194 @@
158 return describePlan(inputOperator);158 return describePlan(inputOperator);
159 }159 }
160160
161 // AncestorLookup_Default interface161 // GroupLookup_Default interface
162162
163 public AncestorLookup_Default(Operator inputOperator,163 public GroupLookup_Default(Operator inputOperator,
164 Group group,164 Group group,
165 RowType rowType,165 RowType inputRowType,
166 Collection<UserTableRowType> ancestorTypes,166 Collection<UserTableRowType> outputRowTypes,
167 API.InputPreservationOption flag,167 API.InputPreservationOption flag,
168 int lookaheadQuantum)168 int lookaheadQuantum)
169 {169 {
170 validateArguments(rowType, ancestorTypes, flag);
171 this.inputOperator = inputOperator;170 this.inputOperator = inputOperator;
172 this.group = group;171 this.group = group;
173 this.rowType = rowType;172 this.inputRowType = inputRowType;
174 this.keepInput = flag == API.InputPreservationOption.KEEP_INPUT;173 this.keepInput = flag == API.InputPreservationOption.KEEP_INPUT;
175 this.lookaheadQuantum = lookaheadQuantum;174 this.lookaheadQuantum = lookaheadQuantum;
176 // Sort ancestor types by depth
177 this.ancestors = new ArrayList<>(ancestorTypes.size());
178 for (UserTableRowType ancestorType : ancestorTypes) {
179 this.ancestors.add(ancestorType.userTable());
180 }
181 if (this.ancestors.size() > 1) {
182 Collections.sort(this.ancestors,
183 new Comparator<UserTable>()
184 {
185 @Override
186 public int compare(UserTable x, UserTable y)
187 {
188 return x.getDepth() - y.getDepth();
189 }
190 });
191 }
192 }
193
194 // For use by this class
195175
196 private void validateArguments(RowType rowType, Collection<UserTableRowType> ancestorTypes, API.InputPreservationOption flag)176 ArgumentValidation.notEmpty("outputRowTypes", outputRowTypes);
197 {177 UserTableRowType tableRowType;
198 ArgumentValidation.notEmpty("ancestorTypes", ancestorTypes);178 if (inputRowType instanceof UserTableRowType) {
199 if (rowType instanceof IndexRowType) {179 tableRowType = (UserTableRowType)inputRowType;
180 } else if (inputRowType instanceof IndexRowType) {
200 // Keeping index rows not supported181 // Keeping index rows not supported
201 ArgumentValidation.isTrue("flag == API.InputPreservationOption.DISCARD_INPUT",182 ArgumentValidation.isTrue("flag == API.InputPreservationOption.DISCARD_INPUT",
202 flag == API.InputPreservationOption.DISCARD_INPUT);183 flag == API.InputPreservationOption.DISCARD_INPUT);
203 RowType tableRowType = ((IndexRowType) rowType).tableType();184 tableRowType = ((IndexRowType) inputRowType).tableType();
204 // Each ancestorType must be an ancestor of rowType. ancestorType = tableRowType is OK only if the input185 } else if (inputRowType instanceof HKeyRowType) {
205 // is from an index. I.e., this operator can be used for an index lookup.
206 for (UserTableRowType ancestorType : ancestorTypes) {
207 ArgumentValidation.isTrue("ancestorType.ancestorOf(tableRowType)",
208 ancestorType.ancestorOf(tableRowType));
209 ArgumentValidation.isTrue("ancestorType.userTable().getGroup() == tableRowType.userTable().getGroup()",
210 ancestorType.userTable().getGroup() == tableRowType.userTable().getGroup());
211 }
212 } else if (rowType instanceof UserTableRowType) {
213 // Each ancestorType must be an ancestor of rowType. ancestorType = tableRowType is OK only if the input
214 // is from an index. I.e., this operator can be used for an index lookup.
215 for (RowType ancestorType : ancestorTypes) {
216 ArgumentValidation.isTrue("ancestorType != tableRowType",
217 ancestorType != rowType);
218 ArgumentValidation.isTrue("ancestorType.ancestorOf(tableRowType)",
219 ancestorType.ancestorOf(rowType));
220 ArgumentValidation.isTrue("ancestorType.userTable().getGroup() == tableRowType.userTable().getGroup()",
221 ancestorType.userTable().getGroup() == rowType.userTable().getGroup());
222 }
223 } else if (rowType instanceof HKeyRowType) {
224 ArgumentValidation.isTrue("flag == API.InputPreservationOption.DISCARD_INPUT",186 ArgumentValidation.isTrue("flag == API.InputPreservationOption.DISCARD_INPUT",
225 flag == API.InputPreservationOption.DISCARD_INPUT);187 flag == API.InputPreservationOption.DISCARD_INPUT);
226 for (UserTableRowType ancestorType : ancestorTypes) {188 tableRowType = ((Schema) inputRowType.schema()).userTableRowType(((HKeyRowType) inputRowType).hKey().userTable());
227 HKeyRowType hKeyRowType = (HKeyRowType) rowType;
228 UserTableRowType tableRowType = ancestorType.schema().userTableRowType(hKeyRowType.hKey().userTable());
229 ArgumentValidation.isTrue("ancestorType.ancestorOf(tableRowType)",
230 ancestorType.ancestorOf(tableRowType));
231 ArgumentValidation.isTrue("ancestorType.userTable().getGroup() == tableRowType.userTable().getGroup()",
232 ancestorType.userTable().getGroup() == tableRowType.userTable().getGroup());
233 }
234 } else {189 } else {
235 ArgumentValidation.isTrue("invalid rowType", false);190 ArgumentValidation.isTrue("invalid rowType", false);
236 }191 tableRowType = null;
192 }
193 UserTable inputTable = tableRowType.userTable();
194 this.ancestors = new ArrayList<>(outputRowTypes.size());
195 List<UserTableRowType> branchOutputRowTypes = null;
196 UserTable branchRoot = null;
197 boolean outputInputTable = false;
198 for (UserTableRowType outputRowType : outputRowTypes) {
199 if (outputRowType == tableRowType) {
200 ArgumentValidation.isTrue("flag == API.InputPreservationOption.DISCARD_INPUT",
201 flag == API.InputPreservationOption.DISCARD_INPUT);
202 outputInputTable = true;
203 } else if (outputRowType.ancestorOf(tableRowType)) {
204 ancestors.add(outputRowType.userTable());
205 } else if (tableRowType.ancestorOf(outputRowType)) {
206 if (branchOutputRowTypes == null)
207 branchOutputRowTypes = new ArrayList<>();
208 branchOutputRowTypes.add(outputRowType);
209 if (branchRoot != inputTable) {
210 // Get immediate child of input above desired output.
211 UserTable childTable = outputRowType.userTable();
212 while (true) {
213 UserTable parentTable = childTable.parentTable();
214 if (parentTable == inputTable) break;
215 childTable = parentTable;
216 }
217 if (branchRoot != childTable) {
218 if (branchRoot == null) {
219 branchRoot = childTable;
220 } else {
221 branchRoot = inputTable;
222 }
223 }
224 }
225 } else {
226 // The old BranchLookup_Default would allow, say, item
227 // to address, but the optimizer never generates that.
228 ArgumentValidation.isTrue("ancestor or descendant", false);
229 }
230 }
231 if (outputInputTable) {
232 if (branchRoot != inputTable) {
233 ancestors.add(inputTable);
234 } else {
235 branchOutputRowTypes.add(tableRowType);
236 }
237 }
238 if (ancestors.size() > 1) {
239 Collections.sort(ancestors, SORT_TABLE_BY_DEPTH);
240 }
241 if (branchOutputRowTypes == null) {
242 this.branchOutputRowTypes = null;
243 this.branchRootOrdinal = -1;
244 } else {
245 if (branchOutputRowTypes.size() > 1) {
246 Collections.sort(branchOutputRowTypes, SORT_ROWTYPE_BY_DEPTH);
247 }
248 this.branchOutputRowTypes = branchOutputRowTypes;
249 if (branchRoot == inputTable) {
250 this.branchRootOrdinal = -1;
251 } else {
252 this.branchRootOrdinal = ordinal(branchRoot);
253 }
254 }
255 }
256
257 // For use by this class
258
259 private static final Comparator<UserTable> SORT_TABLE_BY_DEPTH =
260 new Comparator<UserTable>()
261 {
262 @Override
263 public int compare(UserTable x, UserTable y)
264 {
265 return x.getDepth() - y.getDepth();
266 }
267 };
268 private static final Comparator<UserTableRowType> SORT_ROWTYPE_BY_DEPTH =
269 new Comparator<UserTableRowType>()
270 {
271 @Override
272 public int compare(UserTableRowType x, UserTableRowType y)
273 {
274 return x.userTable().getDepth() - y.userTable().getDepth();
275 }
276 };
277
278 private List<UserTableRowType> outputRowTypes() {
279 List<UserTableRowType> types = new ArrayList<>();
280 for (UserTable table : ancestors) {
281 types.add(((Schema) inputRowType.schema()).userTableRowType(table));
282 }
283 if (branchOutputRowTypes != null) {
284 types.addAll(branchOutputRowTypes);
285 }
286 return types;
287 }
288
289 private static UserTable commonAncestor(UserTable inputTable, UserTable outputTable)
290 {
291 int minLevel = min(inputTable.getDepth(), outputTable.getDepth());
292 UserTable inputAncestor = inputTable;
293 while (inputAncestor.getDepth() > minLevel) {
294 inputAncestor = inputAncestor.parentTable();
295 }
296 UserTable outputAncestor = outputTable;
297 while (outputAncestor.getDepth() > minLevel) {
298 outputAncestor = outputAncestor.parentTable();
299 }
300 while (inputAncestor != outputAncestor) {
301 inputAncestor = inputAncestor.parentTable();
302 outputAncestor = outputAncestor.parentTable();
303 }
304 return outputAncestor;
237 }305 }
238306
239 // Class state307 // Class state
240308
241 private static final Logger LOG = LoggerFactory.getLogger(AncestorLookup_Default.class);309 private static final Logger LOG = LoggerFactory.getLogger(GroupLookup_Default.class);
242 private static final InOutTap TAP_OPEN = OPERATOR_TAP.createSubsidiaryTap("operator: AncestorLookup_Default open");310 private static final InOutTap TAP_OPEN = OPERATOR_TAP.createSubsidiaryTap("operator: GroupLookup_Default open");
243 private static final InOutTap TAP_NEXT = OPERATOR_TAP.createSubsidiaryTap("operator: AncestorLookup_Default next");311 private static final InOutTap TAP_NEXT = OPERATOR_TAP.createSubsidiaryTap("operator: GroupLookup_Default next");
244312
245 // Object state313 // Object state
246314
247 private final Operator inputOperator;315 private final Operator inputOperator;
248 private final Group group;316 private final Group group;
249 private final RowType rowType;317 private final RowType inputRowType;
250 private final List<UserTable> ancestors;318 private final List<UserTable> ancestors;
319 private final List<UserTableRowType> branchOutputRowTypes;
251 private final boolean keepInput;320 private final boolean keepInput;
321 private final int branchRootOrdinal;
252 private final int lookaheadQuantum;322 private final int lookaheadQuantum;
253323
254 @Override324 @Override
255 public CompoundExplainer getExplainer(ExplainContext context)325 public CompoundExplainer getExplainer(ExplainContext context)
256 {326 {
257 Attributes atts = new Attributes();327 Attributes atts = new Attributes();
258 for (UserTable table : ancestors) {328 for (UserTableRowType outputType : outputRowTypes()) {
259 atts.put(Label.OUTPUT_TYPE, ((Schema)rowType.schema()).userTableRowType(table).getExplainer(context));329 atts.put(Label.OUTPUT_TYPE, outputType.getExplainer(context));
260 }330 }
261 return new LookUpOperatorExplainer(getName(), atts, rowType, keepInput, inputOperator, context);331 atts.put(Label.PIPELINE, PrimitiveExplainer.getInstance(lookaheadQuantum));
332 return new LookUpOperatorExplainer(getName(), atts, inputRowType, keepInput, inputOperator, context);
262 }333 }
263334
264 // Inner classes335 // Inner classes
265336
337 private static enum LookupState
338 {
339 // Just opened or after any branch rows
340 BETWEEN,
341 // Ancestors filled in, any branch not open.
342 ANCESTOR,
343 // Scanning branch rows.
344 BRANCH,
345 // Input ran out.
346 EXHAUSTED
347 }
348
266 private class Execution extends ChainedCursor349 private class Execution extends ChainedCursor
267 {350 {
268 // Cursor interface351 // Cursor interface
@@ -274,7 +357,7 @@
274 try {357 try {
275 CursorLifecycle.checkIdle(this);358 CursorLifecycle.checkIdle(this);
276 input.open();359 input.open();
277 advance();360 lookupState = LookupState.BETWEEN;
278 } finally {361 } finally {
279 TAP_OPEN.out();362 TAP_OPEN.out();
280 }363 }
@@ -291,12 +374,12 @@
291 CursorLifecycle.checkIdleOrActive(this);374 CursorLifecycle.checkIdleOrActive(this);
292 }375 }
293 checkQueryCancelation();376 checkQueryCancelation();
294 while (pending.isEmpty() && inputRow.isHolding()) {377 while (pending.isEmpty() && (lookupState != LookupState.EXHAUSTED)) {
295 advance();378 advance();
296 }379 }
297 Row row = pending.take();380 Row row = pending.take();
298 if (LOG_EXECUTION) {381 if (LOG_EXECUTION) {
299 LOG.debug("AncestorLookup: {}", row == null ? null : row);382 LOG.debug("GroupLookup: yield {}", row);
300 }383 }
301 return row;384 return row;
302 } finally {385 } finally {
@@ -312,7 +395,8 @@
312 CursorLifecycle.checkIdleOrActive(this);395 CursorLifecycle.checkIdleOrActive(this);
313 if (input.isActive()) {396 if (input.isActive()) {
314 input.close();397 input.close();
315 ancestorRow.release();398 lookupCursor.close();
399 lookupRow.release();
316 pending.clear();400 pending.clear();
317 }401 }
318 }402 }
@@ -322,6 +406,7 @@
322 {406 {
323 close();407 close();
324 input.destroy();408 input.destroy();
409 lookupCursor.destroy();
325 }410 }
326411
327 // Execution interface412 // Execution interface
@@ -331,17 +416,39 @@
331 super(context, input);416 super(context, input);
332 // Why + 1: Because the input row (whose ancestors get discovered) also goes into pending.417 // Why + 1: Because the input row (whose ancestors get discovered) also goes into pending.
333 this.pending = new PendingRows(ancestors.size() + 1);418 this.pending = new PendingRows(ancestors.size() + 1);
334 this.ancestorCursor = adapter().newGroupCursor(group);419 this.lookupCursor = adapter().newGroupCursor(group);
420 if (branchOutputRowTypes != null) {
421 this.lookupRowHKey = adapter().newHKey(inputRowType.hKey());
422 }
423 else {
424 this.lookupRowHKey = null;
425 }
335 }426 }
336427
337 // For use by this class428 // For use by this class
338429
339 private void advance()430 private void advance()
340 {431 {
432 switch (lookupState) {
433 case BETWEEN:
434 advanceInput();
435 break;
436 case ANCESTOR:
437 advanceLookup();
438 break;
439 case BRANCH:
440 advanceBranch();
441 break;
442 }
443 }
444
445 private void advanceInput()
446 {
341 Row currentRow = input.next();447 Row currentRow = input.next();
342 if (currentRow != null) {448 if (currentRow != null) {
343 if (currentRow.rowType() == rowType) {449 if (currentRow.rowType() == inputRowType) {
344 findAncestors(currentRow);450 findAncestors(currentRow);
451 lookupState = LookupState.ANCESTOR;
345 }452 }
346 if (keepInput) {453 if (keepInput) {
347 pending.add(currentRow);454 pending.add(currentRow);
@@ -349,6 +456,7 @@
349 inputRow.hold(currentRow);456 inputRow.hold(currentRow);
350 } else {457 } else {
351 inputRow.release();458 inputRow.release();
459 lookupState = LookupState.EXHAUSTED;
352 }460 }
353 }461 }
354462
@@ -357,8 +465,8 @@
357 assert pending.isEmpty();465 assert pending.isEmpty();
358 for (int i = 0; i < ancestors.size(); i++) {466 for (int i = 0; i < ancestors.size(); i++) {
359 readAncestorRow(inputRow.ancestorHKey(ancestors.get(i)));467 readAncestorRow(inputRow.ancestorHKey(ancestors.get(i)));
360 if (ancestorRow.isHolding()) {468 if (lookupRow.isHolding()) {
361 pending.add(ancestorRow.get());469 pending.add(lookupRow.get());
362 }470 }
363 }471 }
364 }472 }
@@ -366,27 +474,65 @@
366 private void readAncestorRow(HKey hKey)474 private void readAncestorRow(HKey hKey)
367 {475 {
368 try {476 try {
369 ancestorCursor.rebind(hKey, false);477 lookupCursor.rebind(hKey, false);
370 ancestorCursor.open();478 lookupCursor.open();
371 Row retrievedRow = ancestorCursor.next();479 Row retrievedRow = lookupCursor.next();
372 if (retrievedRow == null) {480 if (retrievedRow == null) {
373 ancestorRow.release();481 lookupRow.release();
374 } else {482 } else {
375 // Retrieved row might not actually be what we were looking for -- not all ancestors are present,483 // Retrieved row might not actually be what we were looking for -- not all ancestors are present,
376 // (there are orphan rows).484 // (there are orphan rows).
377 ancestorRow.hold(hKey.equals(retrievedRow.hKey()) ? retrievedRow : null);485 lookupRow.hold(hKey.equals(retrievedRow.hKey()) ? retrievedRow : null);
378 }486 }
379 } finally {487 } finally {
380 ancestorCursor.close();488 lookupCursor.close();
489 }
490 }
491
492 private void advanceLookup()
493 {
494 if (branchOutputRowTypes == null) {
495 lookupState = LookupState.BETWEEN;
496 return;
497 }
498 lookupRow.release();
499 computeBranchLookupRowHKey(inputRow.get());
500 lookupCursor.rebind(lookupRowHKey, true);
501 lookupCursor.open();
502 lookupState = LookupState.BRANCH;
503 }
504
505 private void computeBranchLookupRowHKey(Row row)
506 {
507 HKey ancestorHKey = row.hKey(); // row.ancestorHKey(commonAncestor);
508 ancestorHKey.copyTo(lookupRowHKey);
509 if (branchRootOrdinal != -1) {
510 lookupRowHKey.extendWithOrdinal(branchRootOrdinal);
511 }
512 }
513
514 private void advanceBranch()
515 {
516 Row currentLookupRow = lookupCursor.next();
517 lookupRow.release();
518 if (currentLookupRow == null) {
519 lookupState = LookupState.BETWEEN;
520 } else if (branchOutputRowTypes.contains(currentLookupRow.rowType())) {
521 lookupRow.hold(currentLookupRow);
522 }
523 if (lookupRow.isHolding()) {
524 pending.add(lookupRow.get());
381 }525 }
382 }526 }
383527
384 // Object state528 // Object state
385529
386 private final ShareHolder<Row> inputRow = new ShareHolder<>();530 private final ShareHolder<Row> inputRow = new ShareHolder<>();
387 private final GroupCursor ancestorCursor;531 private final GroupCursor lookupCursor;
388 private final ShareHolder<Row> ancestorRow = new ShareHolder<>();532 private final ShareHolder<Row> lookupRow = new ShareHolder<>();
389 private final PendingRows pending;533 private final PendingRows pending;
534 private final HKey lookupRowHKey;
535 private LookupState lookupState;
390 }536 }
391537
392 private class LookaheadExecution extends OperatorCursor {538 private class LookaheadExecution extends OperatorCursor {
@@ -398,7 +544,7 @@
398 try {544 try {
399 CursorLifecycle.checkIdle(this);545 CursorLifecycle.checkIdle(this);
400 closed = false;546 closed = false;
401 ancestorIndex = -1;547 cursorIndex = 0;
402 } finally {548 } finally {
403 TAP_OPEN.out();549 TAP_OPEN.out();
404 }550 }
@@ -416,7 +562,6 @@
416 }562 }
417 checkQueryCancelation();563 checkQueryCancelation();
418 Row outputRow = null;564 Row outputRow = null;
419 int nancestors = ancestors.size();
420 while (!closed && outputRow == null) {565 while (!closed && outputRow == null) {
421 // Get some more input rows, crossing bindings boundaries as566 // Get some more input rows, crossing bindings boundaries as
422 // necessary, and open cursors for them.567 // necessary, and open cursors for them.
@@ -444,14 +589,25 @@
444 else {589 else {
445 inputRows[nextIndex].hold(row);590 inputRows[nextIndex].hold(row);
446 if (LOG_EXECUTION) {591 if (LOG_EXECUTION) {
447 LOG.debug("AncestorLookup: new input {}", row);592 LOG.debug("GroupLookup: new input {}", row);
448 }593 }
449 inputRowBindings[nextIndex] = nextBindings;594 inputRowBindings[nextIndex] = nextBindings;
450 for (int i = 0; i < nancestors; i++) {595 for (int i = 0; i < ncursors; i++) {
451 int index = nextIndex * nancestors + i;596 if (i == keepInputCursorIndex) continue;
452 ancestorHKeys[index] = row.ancestorHKey(ancestors.get(i));597 int index = nextIndex * ncursors + i;
453 ancestorCursors[index].rebind(ancestorHKeys[index], false);598 boolean deep = false;
454 ancestorCursors[index].open();599 if (i == branchCursorIndex) {
600 row.hKey().copyTo(lookupHKeys[index]);
601 if (branchRootOrdinal != -1) {
602 lookupHKeys[index].extendWithOrdinal(branchRootOrdinal);
603 }
604 deep = true;
605 }
606 else {
607 lookupHKeys[index] = row.ancestorHKey(ancestors.get(i));
608 }
609 cursors[index].rebind(lookupHKeys[index], deep);
610 cursors[index].open();
455 }611 }
456 nextIndex = (nextIndex + 1) % quantum;612 nextIndex = (nextIndex + 1) % quantum;
457 } 613 }
@@ -463,34 +619,43 @@
463 else if (inputRowBindings[currentIndex] != currentBindings) {619 else if (inputRowBindings[currentIndex] != currentBindings) {
464 closed = true; // Row came from another bindings.620 closed = true; // Row came from another bindings.
465 }621 }
466 else if (ancestorIndex < 0) {622 else if (cursorIndex >= ncursors) {
467 if (keepInput) {
468 outputRow = inputRows[currentIndex].get();
469 }
470 ancestorIndex++;
471 }
472 else if (ancestorIndex >= nancestors) {
473 // Done with this row.623 // Done with this row.
474 inputRows[currentIndex].release();624 inputRows[currentIndex].release();
475 inputRowBindings[currentIndex] = null;625 inputRowBindings[currentIndex] = null;
476 currentIndex = (currentIndex + 1) % quantum;626 currentIndex = (currentIndex + 1) % quantum;
477 ancestorIndex = -1;627 cursorIndex = 0;
628 }
629 else if (cursorIndex == keepInputCursorIndex) {
630 outputRow = inputRows[currentIndex].get();
631 cursorIndex++;
478 }632 }
479 else {633 else {
480 int index = currentIndex * nancestors + ancestorIndex;634 int index = currentIndex * ncursors + cursorIndex;
481 outputRow = ancestorCursors[index].next();635 outputRow = cursors[index].next();
482 ancestorCursors[index].close();636 if (cursorIndex == branchCursorIndex) {
483 if ((outputRow != null) && 637 // Get all matching rows from branch.
484 !ancestorHKeys[index].equals(outputRow.hKey())) {638 if (outputRow == null) {
485 // Not the row we wanted; no matching ancestor.639 cursorIndex++;
486 outputRow = null;640 }
487 }641 else if (!branchOutputRowTypes.contains(outputRow.rowType())) {
488 ancestorHKeys[index] = null;642 outputRow = null;
489 ancestorIndex++;643 }
644 }
645 else {
646 cursors[index].close();
647 if ((outputRow != null) &&
648 !lookupHKeys[index].equals(outputRow.hKey())) {
649 // Not the row we wanted; no matching ancestor.
650 outputRow = null;
651 }
652 lookupHKeys[index] = null;
653 cursorIndex++;
654 }
490 }655 }
491 }656 }
492 if (LOG_EXECUTION) {657 if (LOG_EXECUTION) {
493 LOG.debug("AncestorLookup: yield {}", outputRow);658 LOG.debug("GroupLookup: yield {}", outputRow);
494 }659 }
495 return outputRow;660 return outputRow;
496 } finally {661 } finally {
@@ -504,15 +669,15 @@
504 public void close() {669 public void close() {
505 CursorLifecycle.checkIdleOrActive(this);670 CursorLifecycle.checkIdleOrActive(this);
506 if (!closed) {671 if (!closed) {
507 int nancestors = ancestors.size();
508 // Any rows for the current bindings being closed need to be discarded.672 // Any rows for the current bindings being closed need to be discarded.
509 while (currentBindings == inputRowBindings[currentIndex]) {673 while (currentBindings == inputRowBindings[currentIndex]) {
510 inputRows[currentIndex].release();674 inputRows[currentIndex].release();
511 inputRowBindings[currentIndex] = null;675 inputRowBindings[currentIndex] = null;
512 for (int i = 0; i < nancestors; i++) {676 for (int i = 0; i < ncursors; i++) {
513 int index = currentIndex * nancestors + i;677 if (i == keepInputCursorIndex) continue;
514 ancestorCursors[index].close();678 int index = currentIndex * ncursors + i;
515 ancestorHKeys[index] = null;679 cursors[index].close();
680 lookupHKeys[index] = null;
516 }681 }
517 currentIndex = (currentIndex + 1) % quantum;682 currentIndex = (currentIndex + 1) % quantum;
518 }683 }
@@ -527,7 +692,7 @@
527 for (ShareHolder<Row> row : inputRows) {692 for (ShareHolder<Row> row : inputRows) {
528 row.release();693 row.release();
529 }694 }
530 for (GroupCursor ancestorCursor : ancestorCursors) {695 for (GroupCursor ancestorCursor : cursors) {
531 if (ancestorCursor != null) {696 if (ancestorCursor != null) {
532 ancestorCursor.destroy();697 ancestorCursor.destroy();
533 }698 }
@@ -586,15 +751,15 @@
586 if (!pending.isAncestor(bindings)) break;751 if (!pending.isAncestor(bindings)) break;
587 pendingBindings.remove();752 pendingBindings.remove();
588 }753 }
589 int nancestors = ancestors.size();
590 while ((inputRowBindings[currentIndex] != null) &&754 while ((inputRowBindings[currentIndex] != null) &&
591 inputRowBindings[currentIndex].isAncestor(bindings)) {755 inputRowBindings[currentIndex].isAncestor(bindings)) {
592 inputRows[currentIndex].release();756 inputRows[currentIndex].release();
593 inputRowBindings[currentIndex] = null;757 inputRowBindings[currentIndex] = null;
594 for (int i = 0; i < nancestors; i++) {758 for (int i = 0; i < ncursors; i++) {
595 int index = currentIndex * nancestors + i;759 if (i == keepInputCursorIndex) continue;
596 ancestorCursors[index].close();760 int index = currentIndex * ncursors + i;
597 ancestorHKeys[index] = null;761 cursors[index].close();
762 lookupHKeys[index] = null;
598 }763 }
599 currentIndex = (currentIndex + 1) % quantum;764 currentIndex = (currentIndex + 1) % quantum;
600 }765 }
@@ -614,18 +779,40 @@
614 this.input = input;779 this.input = input;
615 this.pendingBindings = new ArrayDeque<>(quantum+1);780 this.pendingBindings = new ArrayDeque<>(quantum+1);
616 int nancestors = ancestors.size();781 int nancestors = ancestors.size();
782 int ncursors = nancestors; // Number of actual cursors (for quantum).
783 int nindex = ncursors; // Number of slots.
784 if (keepInput) {
785 this.keepInputCursorIndex = nindex++;
786 }
787 else {
788 this.keepInputCursorIndex = -1;
789 }
790 if (branchOutputRowTypes != null) {
791 this.branchCursorIndex = nindex++;
792 ncursors++;
793 }
794 else {
795 this.branchCursorIndex = -1;
796 }
617 // Convert from number of cursors to number of input rows, rounding up.797 // Convert from number of cursors to number of input rows, rounding up.
618 quantum = (quantum + nancestors - 1) / nancestors;798 quantum = (quantum + ncursors - 1) / ncursors;
619 this.quantum = quantum;799 this.quantum = quantum;
620 this.inputRows = (ShareHolder<Row>[])new ShareHolder[quantum];800 this.inputRows = (ShareHolder<Row>[])new ShareHolder[quantum];
621 this.inputRowBindings = new QueryBindings[quantum];801 this.inputRowBindings = new QueryBindings[quantum];
622 for (int i = 0; i < this.inputRows.length; i++) {802 for (int i = 0; i < this.inputRows.length; i++) {
623 this.inputRows[i] = new ShareHolder<Row>();803 this.inputRows[i] = new ShareHolder<Row>();
624 }804 }
625 this.ancestorCursors = new GroupCursor[quantum * nancestors];805 this.ncursors = nindex;
626 this.ancestorHKeys = new HKey[quantum * nancestors];806 this.cursors = new GroupCursor[quantum * nindex];
627 for (int i = 0; i < this.ancestorCursors.length; i++) {807 this.lookupHKeys = new HKey[quantum * nindex];
628 this.ancestorCursors[i] = adapter().newGroupCursor(group);808 for (int j = 0; j < quantum; j++) {
809 for (int i = 0; i < nindex; i++) {
810 int index = j * nindex + i;
811 if (i != keepInputCursorIndex)
812 this.cursors[index] = adapter().newGroupCursor(group);
813 if (i == branchCursorIndex)
814 this.lookupHKeys[index] = adapter().newHKey(inputRowType.hKey());
815 }
629 }816 }
630 }817 }
631818
@@ -650,9 +837,10 @@
650 private final int quantum;837 private final int quantum;
651 private final ShareHolder<Row>[] inputRows;838 private final ShareHolder<Row>[] inputRows;
652 private final QueryBindings[] inputRowBindings;839 private final QueryBindings[] inputRowBindings;
653 private final GroupCursor[] ancestorCursors;840 private final int ncursors, keepInputCursorIndex, branchCursorIndex;
654 private final HKey[] ancestorHKeys;841 private final GroupCursor[] cursors;
655 private int currentIndex, nextIndex, ancestorIndex;842 private final HKey[] lookupHKeys;
843 private int currentIndex, nextIndex, cursorIndex;
656 private QueryBindings currentBindings, nextBindings;844 private QueryBindings currentBindings, nextBindings;
657 private boolean bindingsExhausted, closed = true, newBindings;845 private boolean bindingsExhausted, closed = true, newBindings;
658 }846 }
659847
=== modified file 'src/main/java/com/akiban/qp/operator/IndexScan_Default.java'
--- src/main/java/com/akiban/qp/operator/IndexScan_Default.java 2013-07-18 18:28:04 +0000
+++ src/main/java/com/akiban/qp/operator/IndexScan_Default.java 2013-07-24 22:52:24 +0000
@@ -279,6 +279,7 @@
279 for (int i = 0; i < ordering.sortColumns(); i++) {279 for (int i = 0; i < ordering.sortColumns(); i++) {
280 atts.put(Label.ORDERING, PrimitiveExplainer.getInstance(ordering.ascending(i) ? "ASC" : "DESC"));280 atts.put(Label.ORDERING, PrimitiveExplainer.getInstance(ordering.ascending(i) ? "ASC" : "DESC"));
281 }281 }
282 atts.put(Label.PIPELINE, PrimitiveExplainer.getInstance(lookaheadQuantum));
282 if (context.hasExtraInfo(this))283 if (context.hasExtraInfo(this))
283 atts.putAll(context.getExtraInfo(this).get()); 284 atts.putAll(context.getExtraInfo(this).get());
284 return new CompoundExplainer(Type.SCAN_OPERATOR, atts);285 return new CompoundExplainer(Type.SCAN_OPERATOR, atts);
285286
=== modified file 'src/main/java/com/akiban/qp/persistitadapter/OperatorBasedRowCollector.java'
--- src/main/java/com/akiban/qp/persistitadapter/OperatorBasedRowCollector.java 2013-07-09 21:10:22 +0000
+++ src/main/java/com/akiban/qp/persistitadapter/OperatorBasedRowCollector.java 2013-07-24 22:52:24 +0000
@@ -274,28 +274,26 @@
274 Operator indexScan = indexScan_Default(indexRowType,274 Operator indexScan = indexScan_Default(indexRowType,
275 descending,275 descending,
276 indexKeyRange);276 indexKeyRange);
277 plan = branchLookup_Default(indexScan,277 List<UserTableRowType> outputTypes = ancestorTypes();
278 outputTypes.add(predicateType);
279 for (RowType rowType : Schema.descendentTypes(predicateType, schema.userTableTypes())) {
280 outputTypes.add((UserTableRowType)rowType);
281 }
282 plan = groupLookup_Default(indexScan,
278 group,283 group,
279 indexRowType,284 indexRowType,
280 predicateType,285 outputTypes,
281 InputPreservationOption.DISCARD_INPUT,286 InputPreservationOption.DISCARD_INPUT,
282 limit);287 1);
283 } else {288 } else {
284 assert !descending;289 assert !descending;
285 plan = groupScan_Default(group);290 plan = groupScan_Default(group);
286 if (scanLimit != ScanLimit.NONE) {
287 if (scanLimit instanceof FixedCountLimit) {
288 plan = limit_Default(plan, ((FixedCountLimit) scanLimit).getLimit());
289 } else if (scanLimit instanceof PredicateLimit) {
290 plan = limit_Default(plan, ((PredicateLimit) scanLimit).getLimit());
291 }
292 }
293 }291 }
294 // Fill in ancestors above predicate292 if (scanLimit != ScanLimit.NONE) {
295 if (queryRootType != predicateType) {293 if (scanLimit instanceof FixedCountLimit) {
296 List<UserTableRowType> ancestorTypes = ancestorTypes();294 plan = limit_Default(plan, ((FixedCountLimit) scanLimit).getLimit());
297 if (!ancestorTypes.isEmpty()) {295 } else if (scanLimit instanceof PredicateLimit) {
298 plan = ancestorLookup_Default(plan, group, predicateType, ancestorTypes, InputPreservationOption.KEEP_INPUT);296 plan = limit_Default(plan, ((PredicateLimit) scanLimit).getLimit());
299 }297 }
300 }298 }
301 // Get rid of everything above query root table.299 // Get rid of everything above query root table.
302300
=== modified file 'src/main/java/com/akiban/server/service/restdml/ModelBuilder.java'
--- src/main/java/com/akiban/server/service/restdml/ModelBuilder.java 2013-07-09 21:10:22 +0000
+++ src/main/java/com/akiban/server/service/restdml/ModelBuilder.java 2013-07-24 22:52:24 +0000
@@ -296,7 +296,7 @@
296 UserTable table = ddlFunctions.getUserTable(session, tableName);296 UserTable table = ddlFunctions.getUserTable(session, tableName);
297 Schema schema = SchemaCache.globalSchema(table.getAIS());297 Schema schema = SchemaCache.globalSchema(table.getAIS());
298 IndexRowType indexRowType = schema.indexRowType(table.getPrimaryKey().getIndex());298 IndexRowType indexRowType = schema.indexRowType(table.getPrimaryKey().getIndex());
299 Operator plan = API.ancestorLookup_Default(299 Operator plan = API.groupLookup_Default(
300 API.indexScan_Default(300 API.indexScan_Default(
301 indexRowType,301 indexRowType,
302 true,302 true,
@@ -305,7 +305,8 @@
305 table.getGroup(),305 table.getGroup(),
306 indexRowType,306 indexRowType,
307 Collections.singleton(schema.userTableRowType(table)),307 Collections.singleton(schema.userTableRowType(table)),
308 API.InputPreservationOption.DISCARD_INPUT308 API.InputPreservationOption.DISCARD_INPUT,
309 1
309 );310 );
310 StoreAdapter adapter = store.createAdapter(session, schema);311 StoreAdapter adapter = store.createAdapter(session, schema);
311 QueryContext queryContext = new SimpleQueryContext(adapter);312 QueryContext queryContext = new SimpleQueryContext(adapter);
312313
=== modified file 'src/main/java/com/akiban/server/service/text/FullTextIndexInfo.java'
--- src/main/java/com/akiban/server/service/text/FullTextIndexInfo.java 2013-04-22 19:01:34 +0000
+++ src/main/java/com/akiban/server/service/text/FullTextIndexInfo.java 2013-07-24 22:52:24 +0000
@@ -188,11 +188,12 @@
188 if (!ancestors.isEmpty())188 if (!ancestors.isEmpty())
189 {189 {
190 190
191 ret = API.ancestorLookup_Default(ret,191 ret = API.groupLookup_Default(ret,
192 group,192 group,
193 indexedRowType, 193 indexedRowType,
194 ancestors, 194 ancestors,
195 API.InputPreservationOption.KEEP_INPUT);195 API.InputPreservationOption.KEEP_INPUT,
196 1);
196 }197 }
197 }198 }
198 else199 else
199200
=== modified file 'src/main/java/com/akiban/server/store/StoreGIMaintenance.java'
--- src/main/java/com/akiban/server/store/StoreGIMaintenance.java 2013-07-09 21:10:22 +0000
+++ src/main/java/com/akiban/server/store/StoreGIMaintenance.java 2013-07-24 22:52:24 +0000
@@ -264,9 +264,8 @@
264 rowType.userTable(),264 rowType.userTable(),
265 branchTables.fromRoot().get(0).userTable()265 branchTables.fromRoot().get(0).userTable()
266 );266 );
267 plan = API.ancestorLookup_Default(plan, group, rowType, Collections.singleton(parentRowType), API.InputPreservationOption.DISCARD_INPUT);267 plan = API.groupLookup_Default(plan, group, rowType, Collections.singleton(parentRowType), API.InputPreservationOption.DISCARD_INPUT, 1);
268 plan = API.branchLookup_Default(plan, group, parentRowType, rowType, API.InputPreservationOption.DISCARD_INPUT);268 plan = API.groupLookup_Default(plan, group, parentRowType, Collections.singleton(rowType), API.InputPreservationOption.DISCARD_INPUT, 1);
269 plan = API.filter_Default(plan, Collections.singleton(rowType));
270 return plan;269 return plan;
271 }270 }
272271
@@ -307,22 +306,24 @@
307 }306 }
308 if (!branchTables.leafMost().equals(rowType)) {307 if (!branchTables.leafMost().equals(rowType)) {
309 // the incoming row isn't the leaf, so we have to get its ancestors along the branch308 // the incoming row isn't the leaf, so we have to get its ancestors along the branch
310 UserTableRowType child = branchTables.childOf(rowType);309 List<UserTableRowType> children = branchTables.childrenOf(rowType);
311 plan = API.branchLookup_Default(310 plan = API.groupLookup_Default(
312 plan,311 plan,
313 groupIndex.getGroup(),312 groupIndex.getGroup(),
314 rowType,313 rowType,
315 child,314 children,
316 API.InputPreservationOption.KEEP_INPUT315 API.InputPreservationOption.KEEP_INPUT,
316 1
317 );317 );
318 }318 }
319 if (!branchTables.fromRoot().get(0).equals(rowType)) {319 if (!branchTables.fromRoot().get(0).equals(rowType)) {
320 plan = API.ancestorLookup_Default(320 plan = API.groupLookup_Default(
321 plan,321 plan,
322 groupIndex.getGroup(),322 groupIndex.getGroup(),
323 rowType,323 rowType,
324 ancestors(rowType, branchTables.fromRoot()),324 ancestors(rowType, branchTables.fromRoot()),
325 API.InputPreservationOption.KEEP_INPUT325 API.InputPreservationOption.KEEP_INPUT,
326 1
326 );327 );
327 }328 }
328329
@@ -424,10 +425,10 @@
424 return onlyBranch.get(onlyBranch.size()-1);425 return onlyBranch.get(onlyBranch.size()-1);
425 }426 }
426427
427 public UserTableRowType childOf(UserTableRowType rowType) {428 public List<UserTableRowType> childrenOf(UserTableRowType rowType) {
428 int inputDepth = rowType.userTable().getDepth();429 int inputDepth = rowType.userTable().getDepth();
429 int childDepth = inputDepth + 1;430 int childDepth = inputDepth + 1;
430 return allTablesForBranch.get(childDepth);431 return allTablesForBranch.subList(childDepth, allTablesForBranch.size());
431 }432 }
432433
433 public UserTableRowType parentRowType(UserTableRowType rowType) {434 public UserTableRowType parentRowType(UserTableRowType rowType) {
434435
=== modified file 'src/main/java/com/akiban/sql/optimizer/rule/OperatorAssembler.java'
--- src/main/java/com/akiban/sql/optimizer/rule/OperatorAssembler.java 2013-07-19 18:51:38 +0000
+++ src/main/java/com/akiban/sql/optimizer/rule/OperatorAssembler.java 2013-07-24 22:52:24 +0000
@@ -1434,22 +1434,39 @@
1434 protected RowStream assembleAncestorLookup(AncestorLookup ancestorLookup) {1434 protected RowStream assembleAncestorLookup(AncestorLookup ancestorLookup) {
1435 RowStream stream;1435 RowStream stream;
1436 Group group = ancestorLookup.getDescendant().getGroup();1436 Group group = ancestorLookup.getDescendant().getGroup();
1437 List<UserTableRowType> ancestorTypes =1437 List<UserTableRowType> outputRowTypes =
1438 new ArrayList<>(ancestorLookup.getAncestors().size());1438 new ArrayList<>(ancestorLookup.getAncestors().size());
1439 for (TableNode table : ancestorLookup.getAncestors()) {1439 for (TableNode table : ancestorLookup.getAncestors()) {
1440 ancestorTypes.add(tableRowType(table));1440 outputRowTypes.add(tableRowType(table));
1441 }1441 }
1442 if (ancestorLookup.getInput() instanceof GroupLoopScan) {1442 PlanNode input = ancestorLookup.getInput();
1443 if (input instanceof GroupLoopScan) {
1443 stream = new RowStream();1444 stream = new RowStream();
1444 int rowIndex = lookupNestedBoundRowIndex(((GroupLoopScan)ancestorLookup.getInput()));1445 int rowIndex = lookupNestedBoundRowIndex(((GroupLoopScan)ancestorLookup.getInput()));
1445 ColumnExpressionToIndex boundRow = boundRows.get(rowIndex);1446 ColumnExpressionToIndex boundRow = boundRows.get(rowIndex);
1446 stream.operator = API.ancestorLookup_Nested(group,1447 stream.operator = API.ancestorLookup_Nested(group,
1447 boundRow.getRowType(),1448 boundRow.getRowType(),
1448 ancestorTypes,1449 outputRowTypes,
1449 rowIndex + loopBindingsOffset);1450 rowIndex + loopBindingsOffset);
1450 }1451 }
1451 else {1452 else {
1452 stream = assembleStream(ancestorLookup.getInput());1453 BranchLookup branchLookup = null;
1454 if (input instanceof BranchLookup) {
1455 branchLookup = (BranchLookup)input;
1456 if ((branchLookup.getInput() == null) ||
1457 (branchLookup.getSource().getGroup() != group)) {
1458 branchLookup = null;
1459 }
1460 }
1461 if (branchLookup != null) {
1462 for (TableSource table : branchLookup.getTables()) {
1463 outputRowTypes.add(tableRowType(table));
1464 }
1465 stream = assembleStream(branchLookup.getInput());
1466 stream.unknownTypesPresent = true;
1467 }
1468 else
1469 stream = assembleStream(input);
1453 RowType inputRowType = stream.rowType; // The index row type.1470 RowType inputRowType = stream.rowType; // The index row type.
1454 API.InputPreservationOption flag = API.InputPreservationOption.DISCARD_INPUT;1471 API.InputPreservationOption flag = API.InputPreservationOption.DISCARD_INPUT;
1455 if (!isIndexRowType(inputRowType)) {1472 if (!isIndexRowType(inputRowType)) {
@@ -1457,12 +1474,12 @@
1457 inputRowType = tableRowType(ancestorLookup.getDescendant());1474 inputRowType = tableRowType(ancestorLookup.getDescendant());
1458 flag = API.InputPreservationOption.KEEP_INPUT;1475 flag = API.InputPreservationOption.KEEP_INPUT;
1459 }1476 }
1460 stream.operator = API.ancestorLookup_Default(stream.operator,1477 stream.operator = API.groupLookup_Default(stream.operator,
1461 group,1478 group,
1462 inputRowType,1479 inputRowType,
1463 ancestorTypes,1480 outputRowTypes,
1464 flag,1481 flag,
1465 rulesContext.getPipelineConfiguration().getGroupLookupLookaheadQuantum());1482 rulesContext.getPipelineConfiguration().getGroupLookupLookaheadQuantum());
1466 }1483 }
1467 stream.rowType = null;1484 stream.rowType = null;
1468 stream.fieldOffsets = null;1485 stream.fieldOffsets = null;
@@ -1510,11 +1527,19 @@
1510 inputRowType = tableRowType(branchLookup.getSource());1527 inputRowType = tableRowType(branchLookup.getSource());
1511 flag = API.InputPreservationOption.KEEP_INPUT;1528 flag = API.InputPreservationOption.KEEP_INPUT;
1512 }1529 }
1513 stream.operator = API.branchLookup_Default(stream.operator,1530 List<UserTableRowType> outputRowTypes =
1514 group,1531 new ArrayList<>(branchLookup.getTables().size());
1515 inputRowType,1532 if (false) // TODO: Any way to check that this matched?
1516 tableRowType(branchLookup.getBranch()), 1533 outputRowTypes.add(tableRowType(branchLookup.getBranch()));
1517 flag);1534 for (TableSource table : branchLookup.getTables()) {
1535 outputRowTypes.add(tableRowType(table));
1536 }
1537 stream.operator = API.groupLookup_Default(stream.operator,
1538 group,
1539 inputRowType,
1540 outputRowTypes,
1541 flag,
1542 rulesContext.getPipelineConfiguration().getGroupLookupLookaheadQuantum());
1518 }1543 }
1519 stream.rowType = null;1544 stream.rowType = null;
1520 stream.unknownTypesPresent = true;1545 stream.unknownTypesPresent = true;
15211546
=== modified file 'src/main/java/com/akiban/sql/optimizer/rule/PlanGenerator.java'
--- src/main/java/com/akiban/sql/optimizer/rule/PlanGenerator.java 2013-04-30 23:01:23 +0000
+++ src/main/java/com/akiban/sql/optimizer/rule/PlanGenerator.java 2013-07-24 22:52:24 +0000
@@ -109,9 +109,14 @@
109 public static Operator generateBranchPlan (UserTable table, Operator scan, RowType scanType) {109 public static Operator generateBranchPlan (UserTable table, Operator scan, RowType scanType) {
110 final Schema schema = (Schema)scanType.schema();110 final Schema schema = (Schema)scanType.schema();
111 final UserTableRowType tableType = schema.userTableRowType(table);111 final UserTableRowType tableType = schema.userTableRowType(table);
112 Operator plan = API.branchLookup_Default(scan, table.getGroup(), 112 final List<UserTableRowType> tableTypes = new ArrayList<>();
113 scanType, tableType, 113 tableTypes.add(tableType);
114 API.InputPreservationOption.DISCARD_INPUT);114 for (RowType rowType : Schema.descendentTypes(tableType, schema.userTableTypes())) {
115 tableTypes.add((UserTableRowType)rowType);
116 }
117 Operator plan = API.groupLookup_Default(scan, table.getGroup(),
118 scanType, tableTypes,
119 API.InputPreservationOption.DISCARD_INPUT, 1);
115 120
116 if (logger.isDebugEnabled()) {121 if (logger.isDebugEnabled()) {
117 DefaultFormatter formatter = new DefaultFormatter(table.getName().getSchemaName());122 DefaultFormatter formatter = new DefaultFormatter(table.getName().getSchemaName());
@@ -120,7 +125,7 @@
120 }125 }
121 return plan;126 return plan;
122 }127 }
123 128
124 /**129 /**
125 * Scan a table starting with the primary key and return the full data row 130 * Scan a table starting with the primary key and return the full data row
126 * Generates a plan like131 * Generates a plan like
@@ -137,11 +142,12 @@
137 IndexRowType indexType = schema.indexRowType(table.getPrimaryKeyIncludingInternal().getIndex());142 IndexRowType indexType = schema.indexRowType(table.getPrimaryKeyIncludingInternal().getIndex());
138 143
139 Operator indexScan = generateIndexScan (ais, table);144 Operator indexScan = generateIndexScan (ais, table);
140 Operator lookup = API.ancestorLookup_Default(indexScan,145 Operator lookup = API.groupLookup_Default(indexScan,
141 table.getGroup(),146 table.getGroup(),
142 indexType,147 indexType,
143 ancestorType,148 ancestorType,
144 API.InputPreservationOption.DISCARD_INPUT);149 API.InputPreservationOption.DISCARD_INPUT,
150 1);
145 if (logger.isDebugEnabled()) {151 if (logger.isDebugEnabled()) {
146 DefaultFormatter formatter = new DefaultFormatter(table.getName().getSchemaName());152 DefaultFormatter formatter = new DefaultFormatter(table.getName().getSchemaName());
147 logger.debug("Ancestor Plan for {}:\n{}", table,153 logger.debug("Ancestor Plan for {}:\n{}", table,
148154
=== modified file 'src/test/java/com/akiban/server/service/restdml/DeleteGeneratorIT.java'
--- src/test/java/com/akiban/server/service/restdml/DeleteGeneratorIT.java 2013-03-22 20:05:57 +0000
+++ src/test/java/com/akiban/server/service/restdml/DeleteGeneratorIT.java 2013-07-24 22:52:24 +0000
@@ -60,7 +60,7 @@
60 assertEquals(60 assertEquals(
61 getExplain(delete, table.getSchemaName()),61 getExplain(delete, table.getSchemaName()),
62 "\n Delete_Returning()\n"+62 "\n Delete_Returning()\n"+
63 " AncestorLookup_Default(Index(c.PRIMARY) -> c)\n"+63 " GroupLookup_Default(Index(c.PRIMARY) -> c)\n"+
64 " IndexScan_Default(Index(c.PRIMARY), cid = $1)");64 " IndexScan_Default(Index(c.PRIMARY), cid = $1)");
65 }65 }
6666
@@ -77,7 +77,7 @@
77 assertEquals(77 assertEquals(
78 getExplain(delete, table.getSchemaName()),78 getExplain(delete, table.getSchemaName()),
79 "\n Delete_Returning()\n"+79 "\n Delete_Returning()\n"+
80 " AncestorLookup_Default(Index(c.PRIMARY) -> c)\n"+80 " GroupLookup_Default(Index(c.PRIMARY) -> c)\n"+
81 " IndexScan_Default(Index(c.PRIMARY), cid = $1)");81 " IndexScan_Default(Index(c.PRIMARY), cid = $1)");
82 }82 }
8383
@@ -95,7 +95,7 @@
95 assertEquals(95 assertEquals(
96 getExplain(delete, table.getSchemaName()),96 getExplain(delete, table.getSchemaName()),
97 "\n Delete_Returning()\n"+97 "\n Delete_Returning()\n"+
98 " AncestorLookup_Default(Index(o.PRIMARY) -> o)\n"+98 " GroupLookup_Default(Index(o.PRIMARY) -> o)\n"+
99 " IndexScan_Default(Index(o.PRIMARY), cid = $1, oid = $2)");99 " IndexScan_Default(Index(o.PRIMARY), cid = $1, oid = $2)");
100 }100 }
101 101
@@ -112,7 +112,7 @@
112 assertEquals (112 assertEquals (
113 getExplain(delete, table.getSchemaName()),113 getExplain(delete, table.getSchemaName()),
114 "\n Delete_Returning()\n"+114 "\n Delete_Returning()\n"+
115 " AncestorLookup_Default(Index(c.PRIMARY) -> c)\n"+115 " GroupLookup_Default(Index(c.PRIMARY) -> c)\n"+
116 " IndexScan_Default(Index(c.PRIMARY), __akiban_pk = $1)");116 " IndexScan_Default(Index(c.PRIMARY), __akiban_pk = $1)");
117 }117 }
118118
119119
=== removed file 'src/test/java/com/akiban/server/test/it/qp/BranchLookup_DefaultIT.java'
--- src/test/java/com/akiban/server/test/it/qp/BranchLookup_DefaultIT.java 2013-07-08 18:16:50 +0000
+++ src/test/java/com/akiban/server/test/it/qp/BranchLookup_DefaultIT.java 1970-01-01 00:00:00 +0000
@@ -1,536 +0,0 @@
1/**
2 * Copyright (C) 2009-2013 Akiban Technologies, Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
13 *
14 * You should have received a copy of the GNU Affero General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18package com.akiban.server.test.it.qp;
19
20import com.akiban.qp.expression.IndexBound;
21import com.akiban.qp.expression.IndexKeyRange;
22import com.akiban.qp.operator.Cursor;
23import com.akiban.qp.operator.Operator;
24import com.akiban.qp.row.RowBase;
25import com.akiban.qp.rowtype.IndexRowType;
26import com.akiban.server.api.dml.SetColumnSelector;
27import com.akiban.server.api.dml.scan.NewRow;
28import org.junit.Before;
29import org.junit.Test;
30
31import java.util.Arrays;
32import java.util.Collections;
33
34import static com.akiban.qp.operator.API.*;
35
36public class BranchLookup_DefaultIT extends OperatorITBase
37{
38 @Override
39 protected void setupPostCreateSchema() {
40 super.setupPostCreateSchema();
41 NewRow[] dbWithOrphans = new NewRow[]{
42 createNewRow(customer, 1L, "northbridge"),
43 createNewRow(customer, 2L, "foundation"),
44 createNewRow(customer, 4L, "highland"),
45 createNewRow(address, 1001L, 1L, "111 1111 st"),
46 createNewRow(address, 1002L, 1L, "111 2222 st"),
47 createNewRow(address, 2001L, 2L, "222 1111 st"),
48 createNewRow(address, 2002L, 2L, "222 2222 st"),
49 createNewRow(address, 4001L, 4L, "444 1111 st"),
50 createNewRow(address, 4002L, 4L, "444 2222 st"),
51 createNewRow(order, 11L, 1L, "ori"),
52 createNewRow(order, 12L, 1L, "david"),
53 createNewRow(order, 21L, 2L, "tom"),
54 createNewRow(order, 22L, 2L, "jack"),
55 createNewRow(order, 31L, 3L, "peter"),
56 createNewRow(item, 111L, 11L),
57 createNewRow(item, 112L, 11L),
58 createNewRow(item, 121L, 12L),
59 createNewRow(item, 122L, 12L),
60 createNewRow(item, 211L, 21L),
61 createNewRow(item, 212L, 21L),
62 createNewRow(item, 221L, 22L),
63 createNewRow(item, 222L, 22L),
64 // orphans
65 createNewRow(address, 5001L, 5L, "555 1111 st"),
66 createNewRow(item, 311L, 31L),
67 createNewRow(item, 312L, 31L)};
68 use(dbWithOrphans);
69 }
70
71 // IllegalArumentException tests
72
73 @Test(expected = IllegalArgumentException.class)
74 public void testNullInputRowType()
75 {
76 branchLookup_Default(groupScan_Default(coi),
77 coi,
78 null,
79 customerRowType,
80 InputPreservationOption.KEEP_INPUT);
81 }
82
83 @Test(expected = IllegalArgumentException.class)
84 public void testNullOutputRowType()
85 {
86 branchLookup_Default(groupScan_Default(coi),
87 coi,
88 customerRowType,
89 null,
90 InputPreservationOption.KEEP_INPUT);
91 }
92
93 @Test(expected = IllegalArgumentException.class)
94 public void testLookupSelf()
95 {
96 branchLookup_Default(groupScan_Default(coi),
97 coi,
98 customerRowType,
99 customerRowType,
100 InputPreservationOption.KEEP_INPUT);
101 }
102
103 @Test
104 public void testLookupSelfFromIndex()
105 {
106 branchLookup_Default(groupScan_Default(coi),
107 coi,
108 customerNameIndexRowType,
109 customerRowType,
110 InputPreservationOption.DISCARD_INPUT);
111 }
112
113 @Test(expected = IllegalArgumentException.class)
114 public void testKeepIndexInput()
115 {
116 branchLookup_Default(groupScan_Default(coi),
117 coi,
118 customerNameIndexRowType,
119 customerRowType,
120 InputPreservationOption.KEEP_INPUT);
121 }
122
123 @Test(expected = IllegalArgumentException.class)
124 public void testBranchNonRootLookup()
125 {
126 branchLookup_Default(groupScan_Default(coi),
127 coi,
128 addressRowType,
129 itemRowType,
130 InputPreservationOption.KEEP_INPUT);
131 }
132
133 @Test
134 public void testBranchRootLookup()
135 {
136 branchLookup_Default(groupScan_Default(coi),
137 coi,
138 addressRowType,
139 orderRowType,
140 InputPreservationOption.KEEP_INPUT);
141 }
142
143 // customer index -> customer + descendents
144
145 @Test
146 public void testCustomerIndexToMissingCustomer()
147 {
148 Operator plan = customerNameToCustomerPlan("matrix");
149 Cursor cursor = cursor(plan, queryContext, queryBindings);
150 RowBase[] expected = new RowBase[]{};
151 compareRows(expected, cursor);
152 }
153
154 @Test
155 public void testCustomerIndexToCustomer()
156 {
157 Operator plan = customerNameToCustomerPlan("northbridge");
158 Cursor cursor = cursor(plan, queryContext, queryBindings);
159 RowBase[] expected = new RowBase[]{
160 row(customerRowType, 1L, "northbridge"),
161 row(orderRowType, 11L, 1L, "ori"),
162 row(itemRowType, 111L, 11L),
163 row(itemRowType, 112L, 11L),
164 row(orderRowType, 12L, 1L, "david"),
165 row(itemRowType, 121L, 12L),
166 row(itemRowType, 122L, 12L),
167 row(addressRowType, 1001L, 1L, "111 1111 st"),
168 row(addressRowType, 1002L, 1L, "111 2222 st")
169 };
170 compareRows(expected, cursor);
171 }
172
173 @Test
174 public void testCustomerIndexToCustomerWithNoOrders()
175 {
176 Operator plan = customerNameToCustomerPlan("highland");
177 Cursor cursor = cursor(plan, queryContext, queryBindings);
178 RowBase[] expected = new RowBase[]{
179 row(customerRowType, 4L, "highland"),
180 row(addressRowType, 4001L, 4L, "444 1111 st"),
181 row(addressRowType, 4002L, 4L, "444 2222 st")
182 };
183 compareRows(expected, cursor);
184 }
185
186 // address index -> customer + descendents
187
188 @Test
189 public void testAddressIndexToMissingCustomer()
190 {
191 Operator plan = addressAddressToCustomerPlan("555 1111 st");
192 Cursor cursor = cursor(plan, queryContext, queryBindings);
193 RowBase[] expected = new RowBase[]{
194 row(addressRowType, 5001L, 5L, "555 1111 st"),
195 };
196 compareRows(expected, cursor);
197 }
198
199 @Test
200 public void testAddressIndexToCustomer()
201 {
202 Operator plan = addressAddressToCustomerPlan("222 2222 st");
203 Cursor cursor = cursor(plan, queryContext, queryBindings);
204 RowBase[] expected = new RowBase[]{
205 row(customerRowType, 2L, "foundation"),
206 row(orderRowType, 21L, 2L, "tom"),
207 row(itemRowType, 211L, 21L),
208 row(itemRowType, 212L, 21L),
209 row(orderRowType, 22L, 2L, "jack"),
210 row(itemRowType, 221L, 22L),
211 row(itemRowType, 222L, 22L),
212 row(addressRowType, 2001L, 2L, "222 1111 st"),
213 row(addressRowType, 2002L, 2L, "222 2222 st")
214 };
215 compareRows(expected, cursor);
216 }
217
218 // address row -> customer + descendents
219
220 @Test
221 public void testAddressToMissingCustomer()
222 {
223 Operator plan = addressToCustomerPlan("555 1111 st");
224 Cursor cursor = cursor(plan, queryContext, queryBindings);
225 RowBase[] expected = new RowBase[]{
226 row(addressRowType, 5001L, 5L, "555 1111 st"),
227 };
228 compareRows(expected, cursor);
229 }
230
231 @Test
232 public void testAddressToCustomer()
233 {
234 Operator plan = addressToCustomerPlan("222 2222 st");
235 Cursor cursor = cursor(plan, queryContext, queryBindings);
236 RowBase[] expected = new RowBase[]{
237 row(customerRowType, 2L, "foundation"),
238 row(orderRowType, 21L, 2L, "tom"),
239 row(itemRowType, 211L, 21L),
240 row(itemRowType, 212L, 21L),
241 row(orderRowType, 22L, 2L, "jack"),
242 row(itemRowType, 221L, 22L),
243 row(itemRowType, 222L, 22L),
244 row(addressRowType, 2001L, 2L, "222 1111 st"),
245 row(addressRowType, 2002L, 2L, "222 2222 st")
246 };
247 compareRows(expected, cursor);
248 }
249
250 // address row -> order + descendents
251
252 @Test
253 public void testAddressToOrder()
254 {
255 Operator plan = addressToOrderPlan("222 2222 st", false);
256 Cursor cursor = cursor(plan, queryContext, queryBindings);
257 RowBase[] expected = new RowBase[]{
258 row(orderRowType, 21L, 2L, "tom"),
259 row(itemRowType, 211L, 21L),
260 row(itemRowType, 212L, 21L),
261 row(orderRowType, 22L, 2L, "jack"),
262 row(itemRowType, 221L, 22L),
263 row(itemRowType, 222L, 22L)
264 };
265 compareRows(expected, cursor);
266 }
267
268 @Test
269 public void testAddressToMissingOrder()
270 {
271 Operator plan = addressToOrderPlan("444 2222 st", false);
272 Cursor cursor = cursor(plan, queryContext, queryBindings);
273 RowBase[] expected = new RowBase[]{
274 };
275 compareRows(expected, cursor);
276 }
277
278 // Ordering of input row relative to branch
279
280 @Test
281 public void testAddressToOrderAndAddress()
282 {
283 Operator plan = addressToOrderPlan("222 2222 st", true);
284 Cursor cursor = cursor(plan, queryContext, queryBindings);
285 RowBase[] expected = new RowBase[]{
286 row(orderRowType, 21L, 2L, "tom"),
287 row(itemRowType, 211L, 21L),
288 row(itemRowType, 212L, 21L),
289 row(orderRowType, 22L, 2L, "jack"),
290 row(itemRowType, 221L, 22L),
291 row(itemRowType, 222L, 22L),
292 row(addressRowType, 2002L, 2L, "222 2222 st"),
293 };
294 compareRows(expected, cursor);
295 }
296
297 @Test
298 public void testOrderToOrderAndAddress()
299 {
300 Operator plan = orderToAddressPlan("tom", true);
301 Cursor cursor = cursor(plan, queryContext, queryBindings);
302 RowBase[] expected = new RowBase[]{
303 row(orderRowType, 21L, 2L, "tom"),
304 row(addressRowType, 2001L, 2L, "222 1111 st"),
305 row(addressRowType, 2002L, 2L, "222 2222 st")
306 };
307 compareRows(expected, cursor);
308 }
309
310 @Test
311 public void testItemToItemAndAddress()
312 {
313 Operator plan = itemToAddressPlan(111L, true);
314 Cursor cursor = cursor(plan, queryContext, queryBindings);
315 RowBase[] expected = new RowBase[]{
316 row(itemRowType, 111L, 11L),
317 row(addressRowType, 1001L, 1L, "111 1111 st"),
318 row(addressRowType, 1002L, 1L, "111 2222 st"),
319 };
320 compareRows(expected, cursor);
321 }
322
323 @Test
324 public void testOrderUnionToAddress()
325 {
326 Operator orderOrItem =
327 hKeyUnion_Ordered(
328 indexScan_Default(orderSalesmanIndexRowType, false, orderSalesmanEQ("ori")),
329 indexScan_Default(orderSalesmanIndexRowType, false, orderSalesmanEQ("david")),
330 orderSalesmanIndexRowType,
331 orderSalesmanIndexRowType,
332 2,
333 2,
334 1,
335 customerRowType);
336 Operator plan =
337 branchLookup_Default(
338 orderOrItem,
339 coi,
340 orderOrItem.rowType(),
341 addressRowType,
342 InputPreservationOption.DISCARD_INPUT);
343 Cursor cursor = cursor(plan, queryContext, queryBindings);
344 RowBase[] expected = new RowBase[]{
345 row(addressRowType, 1001L, 1L, "111 1111 st"),
346 row(addressRowType, 1002L, 1L, "111 2222 st"),
347 };
348 compareRows(expected, cursor);
349 }
350
351 @Test
352 public void testCursor()
353 {
354 Operator plan =
355 branchLookup_Default(
356 filter_Default(
357 groupScan_Default(coi),
358 Collections.singleton(customerRowType)),
359 coi,
360 customerRowType,
361 addressRowType,
362 InputPreservationOption.DISCARD_INPUT);
363 CursorLifecycleTestCase testCase = new CursorLifecycleTestCase()
364 {
365 @Override
366 public RowBase[] firstExpectedRows()
367 {
368 return new RowBase[] {
369 row(addressRowType, 1001L, 1L, "111 1111 st"),
370 row(addressRowType, 1002L, 1L, "111 2222 st"),
371 row(addressRowType, 2001L, 2L, "222 1111 st"),
372 row(addressRowType, 2002L, 2L, "222 2222 st"),
373 row(addressRowType, 4001L, 4L, "444 1111 st"),
374 row(addressRowType, 4002L, 4L, "444 2222 st"),
375 };
376 }
377 };
378 testCursorLifecycle(plan, testCase);
379 }
380
381 @Test
382 public void testPKAccess() {
383 Operator plan =
384 branchLookup_Default(
385 indexScan_Default(indexType(order, "oid"), false, orderIdEQ(11L)),
386 coi,
387 indexType(order, "oid"),
388 orderRowType,
389 InputPreservationOption.DISCARD_INPUT);
390 Cursor cursor = cursor(plan, queryContext, queryBindings);
391 RowBase[] expected = new RowBase[]{
392 row(orderRowType, 11L, 1L, "ori"),
393 row(itemRowType, 111L, 11L),
394 row(itemRowType, 112L, 11L),
395 };
396 compareRows(expected, cursor);
397 }
398 // For use by this class
399
400 private Operator customerNameToCustomerPlan(String customerName)
401 {
402 return
403 branchLookup_Default(
404 indexScan_Default(customerNameIndexRowType, false, customerNameEQ(customerName)),
405 coi,
406 customerNameIndexRowType,
407 customerRowType,
408 InputPreservationOption.DISCARD_INPUT);
409 }
410
411 private Operator addressAddressToCustomerPlan(String address)
412 {
413 return
414 branchLookup_Default(
415 indexScan_Default(addressAddressIndexRowType, false, addressAddressEQ(address)),
416 coi,
417 addressAddressIndexRowType,
418 customerRowType,
419 InputPreservationOption.DISCARD_INPUT);
420 }
421
422 private Operator addressToCustomerPlan(String address)
423 {
424 return
425 branchLookup_Default(
426 branchLookup_Default(
427 indexScan_Default(addressAddressIndexRowType, false, addressAddressEQ(address)),
428 coi,
429 addressAddressIndexRowType,
430 addressRowType,
431 InputPreservationOption.DISCARD_INPUT),
432 coi,
433 addressRowType,
434 customerRowType,
435 InputPreservationOption.DISCARD_INPUT);
436 }
437
438 private Operator addressToOrderPlan(String address, boolean keepInput)
439 {
440 return
441 branchLookup_Default(
442 ancestorLookup_Default(
443 indexScan_Default(addressAddressIndexRowType, false, addressAddressEQ(address)),
444 coi,
445 addressAddressIndexRowType,
446 Arrays.asList(addressRowType),
447 InputPreservationOption.DISCARD_INPUT),
448 coi,
449 addressRowType,
450 orderRowType,
451 keepInput ? InputPreservationOption.KEEP_INPUT : InputPreservationOption.DISCARD_INPUT);
452 }
453
454 private Operator orderToAddressPlan(String salesman, boolean keepInput)
455 {
456 return
457 branchLookup_Default(
458 ancestorLookup_Default(
459 indexScan_Default(orderSalesmanIndexRowType, false, orderSalesmanEQ(salesman)),
460 coi,
461 orderSalesmanIndexRowType,
462 Arrays.asList(orderRowType),
463 InputPreservationOption.DISCARD_INPUT),
464 coi,
465 orderRowType,
466 addressRowType,
467 keepInput ? InputPreservationOption.KEEP_INPUT : InputPreservationOption.DISCARD_INPUT);
468 }
469
470 private Operator itemToAddressPlan(long iid, boolean keepInput)
471 {
472 return
473 branchLookup_Default(
474 ancestorLookup_Default(
475 indexScan_Default(itemIidIndexRowType, false, itemIidEQ(iid)),
476 coi,
477 itemIidIndexRowType,
478 Arrays.asList(itemRowType),
479 InputPreservationOption.DISCARD_INPUT),
480 coi,
481 itemRowType,
482 addressRowType,
483 keepInput ? InputPreservationOption.KEEP_INPUT : InputPreservationOption.DISCARD_INPUT);
484 }
485
486 private IndexKeyRange customerNameEQ(String name)
487 {
488 IndexBound bound = customerNameIndexBound(name);
489 return IndexKeyRange.bounded(customerNameIndexRowType, bound, true, bound, true);
490 }
491
492 private IndexKeyRange addressAddressEQ(String address)
493 {
494 IndexBound bound = addressAddressIndexBound(address);
495 return IndexKeyRange.bounded(addressAddressIndexRowType, bound, true, bound, true);
496 }
497
498 private IndexKeyRange orderSalesmanEQ(String salesman)
499 {
500 IndexBound bound = orderSalesmanIndexBound(salesman);
501 return IndexKeyRange.bounded(orderSalesmanIndexRowType, bound, true, bound, true);
502 }
503
504 private IndexKeyRange orderIdEQ(long oid)
505 {
506 IndexRowType indexRowType = indexType(order, "oid");
507 IndexBound bound = new IndexBound(row(indexRowType, oid), new SetColumnSelector(0));
508 return IndexKeyRange.bounded(indexRowType, bound, true, bound, true);
509
510 }
511 private IndexKeyRange itemIidEQ(long iid)
512 {
513 IndexBound bound = itemIidIndexBound(iid);
514 return IndexKeyRange.bounded(itemIidIndexRowType, bound, true, bound, true);
515 }
516
517 private IndexBound customerNameIndexBound(String name)
518 {
519 return new IndexBound(row(customerNameIndexRowType, name), new SetColumnSelector(0));
520 }
521
522 private IndexBound addressAddressIndexBound(String addr)
523 {
524 return new IndexBound(row(addressAddressIndexRowType, addr), new SetColumnSelector(0));
525 }
526
527 private IndexBound orderSalesmanIndexBound(String salesman)
528 {
529 return new IndexBound(row(orderSalesmanIndexRowType, salesman), new SetColumnSelector(0));
530 }
531
532 private IndexBound itemIidIndexBound(long iid)
533 {
534 return new IndexBound(row(itemIidIndexRowType, iid), new SetColumnSelector(0));
535 }
536}
5370
=== renamed file 'src/test/java/com/akiban/server/test/it/qp/AncestorLookup_DefaultIT.java' => 'src/test/java/com/akiban/server/test/it/qp/GroupLookup_DefaultIT.java'
--- src/test/java/com/akiban/server/test/it/qp/AncestorLookup_DefaultIT.java 2013-07-08 18:16:50 +0000
+++ src/test/java/com/akiban/server/test/it/qp/GroupLookup_DefaultIT.java 2013-07-24 22:52:24 +0000
@@ -22,19 +22,24 @@
22import com.akiban.qp.operator.Cursor;22import com.akiban.qp.operator.Cursor;
23import com.akiban.qp.operator.Operator;23import com.akiban.qp.operator.Operator;
24import com.akiban.qp.row.RowBase;24import com.akiban.qp.row.RowBase;
25import com.akiban.qp.rowtype.IndexRowType;
26import com.akiban.qp.rowtype.RowType;
27import com.akiban.qp.rowtype.Schema;
25import com.akiban.qp.rowtype.UserTableRowType;28import com.akiban.qp.rowtype.UserTableRowType;
26import com.akiban.server.api.dml.SetColumnSelector;29import com.akiban.server.api.dml.SetColumnSelector;
27import com.akiban.server.api.dml.scan.NewRow;30import com.akiban.server.api.dml.scan.NewRow;
28import org.junit.Before;31import org.junit.Before;
32import org.junit.Ignore;
29import org.junit.Test;33import org.junit.Test;
3034
35import java.util.ArrayList;
31import java.util.Arrays;36import java.util.Arrays;
32import java.util.Collections;37import java.util.Collections;
33import java.util.List;38import java.util.List;
3439
35import static com.akiban.qp.operator.API.*;40import static com.akiban.qp.operator.API.*;
3641
37public class AncestorLookup_DefaultIT extends OperatorITBase42public class GroupLookup_DefaultIT extends OperatorITBase
38{43{
39 @Override44 @Override
40 protected void setupPostCreateSchema() {45 protected void setupPostCreateSchema() {
@@ -42,6 +47,13 @@
42 NewRow[] dbWithOrphans = new NewRow[]{47 NewRow[] dbWithOrphans = new NewRow[]{
43 createNewRow(customer, 1L, "northbridge"),48 createNewRow(customer, 1L, "northbridge"),
44 createNewRow(customer, 2L, "foundation"),49 createNewRow(customer, 2L, "foundation"),
50 createNewRow(customer, 4L, "highland"),
51 createNewRow(address, 1001L, 1L, "111 1111 st"),
52 createNewRow(address, 1002L, 1L, "111 2222 st"),
53 createNewRow(address, 2001L, 2L, "222 1111 st"),
54 createNewRow(address, 2002L, 2L, "222 2222 st"),
55 createNewRow(address, 4001L, 4L, "444 1111 st"),
56 createNewRow(address, 4002L, 4L, "444 2222 st"),
45 createNewRow(order, 11L, 1L, "ori"),57 createNewRow(order, 11L, 1L, "ori"),
46 createNewRow(order, 12L, 1L, "david"),58 createNewRow(order, 12L, 1L, "david"),
47 createNewRow(order, 21L, 2L, "tom"),59 createNewRow(order, 21L, 2L, "tom"),
@@ -56,51 +68,71 @@
56 createNewRow(item, 221L, 22L),68 createNewRow(item, 221L, 22L),
57 createNewRow(item, 222L, 22L),69 createNewRow(item, 222L, 22L),
58 // orphans70 // orphans
71 createNewRow(address, 5001L, 5L, "555 1111 st"),
59 createNewRow(item, 311L, 31L),72 createNewRow(item, 311L, 31L),
60 createNewRow(item, 312L, 31L)};73 createNewRow(item, 312L, 31L)};
61 use(dbWithOrphans);74 use(dbWithOrphans);
62 }75 }
6376
77 protected int lookaheadQuantum() {
78 return 1;
79 }
80
64 // IllegalArumentException tests81 // IllegalArumentException tests
6582
66 @Test(expected = IllegalArgumentException.class)83 @Test(expected = IllegalArgumentException.class)
67 public void testAtLeastOneAncestor()84 public void testAtLeastOneAncestor()
68 {85 {
69 ancestorLookup_Default(groupScan_Default(coi),86 groupLookup_Default(groupScan_Default(coi),
70 coi,87 coi,
71 customerRowType,88 customerRowType,
72 list(),89 list(),
73 InputPreservationOption.KEEP_INPUT);90 InputPreservationOption.KEEP_INPUT,
74 }91 lookaheadQuantum());
7592 }
76 @Test(expected = IllegalArgumentException.class)93
77 public void testDescendentIsNotAncestor()94 @Test(expected = IllegalArgumentException.class)
78 {95 public void testKeepInputSelf()
79 ancestorLookup_Default(groupScan_Default(coi),96 {
80 coi,97 groupLookup_Default(groupScan_Default(coi),
81 customerRowType,98 coi,
82 list(itemRowType),99 customerRowType,
83 InputPreservationOption.KEEP_INPUT);100 list(customerRowType),
84 }101 InputPreservationOption.KEEP_INPUT,
85102 lookaheadQuantum());
86 @Test(expected = IllegalArgumentException.class)
87 public void testSelfIsNotAncestor()
88 {
89 ancestorLookup_Default(groupScan_Default(coi),
90 coi,
91 customerRowType,
92 list(customerRowType),
93 InputPreservationOption.KEEP_INPUT);
94 }103 }
95104
96 @Test(expected = IllegalArgumentException.class)105 @Test(expected = IllegalArgumentException.class)
97 public void testKeepIndexInput()106 public void testKeepIndexInput()
98 {107 {
99 ancestorLookup_Default(groupScan_Default(coi),108 groupLookup_Default(groupScan_Default(coi),
100 coi,109 coi,
101 customerNameIndexRowType,110 customerNameIndexRowType,
102 list(customerRowType),111 list(customerRowType),
103 InputPreservationOption.KEEP_INPUT);112 InputPreservationOption.KEEP_INPUT,
113 lookaheadQuantum());
114 }
115
116 @Test(expected = IllegalArgumentException.class)
117 public void testBranchNonRootLookup()
118 {
119 groupLookup_Default(groupScan_Default(coi),
120 coi,
121 addressRowType,
122 list(itemRowType),
123 InputPreservationOption.KEEP_INPUT,
124 lookaheadQuantum());
125 }
126
127 @Test(expected = IllegalArgumentException.class)
128 public void testBranchRootLookup()
129 {
130 groupLookup_Default(groupScan_Default(coi),
131 coi,
132 addressRowType,
133 list(orderRowType, itemRowType),
134 InputPreservationOption.KEEP_INPUT,
135 lookaheadQuantum());
104 }136 }
105137
106 // Test ancestor lookup given index row138 // Test ancestor lookup given index row
@@ -334,18 +366,292 @@
334 compareRows(expected, cursor(plan, queryContext, queryBindings));366 compareRows(expected, cursor(plan, queryContext, queryBindings));
335 }367 }
336368
369 // customer index -> customer + descendents
370
371 @Test
372 public void testCustomerIndexToMissingCustomer()
373 {
374 Operator plan = customerNameToCustomerPlan("matrix");
375 Cursor cursor = cursor(plan, queryContext, queryBindings);
376 RowBase[] expected = new RowBase[]{};
377 compareRows(expected, cursor);
378 }
379
380 @Test
381 public void testCustomerIndexToCustomer()
382 {
383 Operator plan = customerNameToCustomerPlan("northbridge");
384 Cursor cursor = cursor(plan, queryContext, queryBindings);
385 RowBase[] expected = new RowBase[]{
386 row(customerRowType, 1L, "northbridge"),
387 row(orderRowType, 11L, 1L, "ori"),
388 row(itemRowType, 111L, 11L),
389 row(itemRowType, 112L, 11L),
390 row(orderRowType, 12L, 1L, "david"),
391 row(itemRowType, 121L, 12L),
392 row(itemRowType, 122L, 12L),
393 row(addressRowType, 1001L, 1L, "111 1111 st"),
394 row(addressRowType, 1002L, 1L, "111 2222 st")
395 };
396 compareRows(expected, cursor);
397 }
398
399 @Test
400 public void testCustomerIndexToCustomerWithNoOrders()
401 {
402 Operator plan = customerNameToCustomerPlan("highland");
403 Cursor cursor = cursor(plan, queryContext, queryBindings);
404 RowBase[] expected = new RowBase[]{
405 row(customerRowType, 4L, "highland"),
406 row(addressRowType, 4001L, 4L, "444 1111 st"),
407 row(addressRowType, 4002L, 4L, "444 2222 st")
408 };
409 compareRows(expected, cursor);
410 }
411
412 // address index -> customer + descendents
413 // MOSTLY IGNORE since not supported by GroupLookup_Default currently.
414
415 @Test @Ignore
416 public void testAddressIndexToMissingCustomer()
417 {
418 Operator plan = addressAddressToCustomerPlan("555 1111 st");
419 Cursor cursor = cursor(plan, queryContext, queryBindings);
420 RowBase[] expected = new RowBase[]{
421 row(addressRowType, 5001L, 5L, "555 1111 st"),
422 };
423 compareRows(expected, cursor);
424 }
425
426 @Test @Ignore
427 public void testAddressIndexToCustomer()
428 {
429 Operator plan = addressAddressToCustomerPlan("222 2222 st");
430 Cursor cursor = cursor(plan, queryContext, queryBindings);
431 RowBase[] expected = new RowBase[]{
432 row(customerRowType, 2L, "foundation"),
433 row(orderRowType, 21L, 2L, "tom"),
434 row(itemRowType, 211L, 21L),
435 row(itemRowType, 212L, 21L),
436 row(orderRowType, 22L, 2L, "jack"),
437 row(itemRowType, 221L, 22L),
438 row(itemRowType, 222L, 22L),
439 row(addressRowType, 2001L, 2L, "222 1111 st"),
440 row(addressRowType, 2002L, 2L, "222 2222 st")
441 };
442 compareRows(expected, cursor);
443 }
444
445 // address row -> customer + descendents
446
447 @Test @Ignore
448 public void testAddressToMissingCustomer()
449 {
450 Operator plan = addressToCustomerPlan("555 1111 st");
451 Cursor cursor = cursor(plan, queryContext, queryBindings);
452 RowBase[] expected = new RowBase[]{
453 row(addressRowType, 5001L, 5L, "555 1111 st"),
454 };
455 compareRows(expected, cursor);
456 }
457
458 @Test @Ignore
459 public void testAddressToCustomer()
460 {
461 Operator plan = addressToCustomerPlan("222 2222 st");
462 Cursor cursor = cursor(plan, queryContext, queryBindings);
463 RowBase[] expected = new RowBase[]{
464 row(customerRowType, 2L, "foundation"),
465 row(orderRowType, 21L, 2L, "tom"),
466 row(itemRowType, 211L, 21L),
467 row(itemRowType, 212L, 21L),
468 row(orderRowType, 22L, 2L, "jack"),
469 row(itemRowType, 221L, 22L),
470 row(itemRowType, 222L, 22L),
471 row(addressRowType, 2001L, 2L, "222 1111 st"),
472 row(addressRowType, 2002L, 2L, "222 2222 st")
473 };
474 compareRows(expected, cursor);
475 }
476
477 // address row -> order + descendents
478
479 @Test @Ignore
480 public void testAddressToOrder()
481 {
482 Operator plan = addressToOrderPlan("222 2222 st", false);
483 Cursor cursor = cursor(plan, queryContext, queryBindings);
484 RowBase[] expected = new RowBase[]{
485 row(orderRowType, 21L, 2L, "tom"),
486 row(itemRowType, 211L, 21L),
487 row(itemRowType, 212L, 21L),
488 row(orderRowType, 22L, 2L, "jack"),
489 row(itemRowType, 221L, 22L),
490 row(itemRowType, 222L, 22L)
491 };
492 compareRows(expected, cursor);
493 }
494
495 @Test @Ignore
496 public void testAddressToMissingOrder()
497 {
498 Operator plan = addressToOrderPlan("444 2222 st", false);
499 Cursor cursor = cursor(plan, queryContext, queryBindings);
500 RowBase[] expected = new RowBase[]{
501 };
502 compareRows(expected, cursor);
503 }
504
505 // Ordering of input row relative to branch
506
507 @Test @Ignore
508 public void testAddressToOrderAndAddress()
509 {
510 Operator plan = addressToOrderPlan("222 2222 st", true);
511 Cursor cursor = cursor(plan, queryContext, queryBindings);
512 RowBase[] expected = new RowBase[]{
513 row(orderRowType, 21L, 2L, "tom"),
514 row(itemRowType, 211L, 21L),
515 row(itemRowType, 212L, 21L),
516 row(orderRowType, 22L, 2L, "jack"),
517 row(itemRowType, 221L, 22L),
518 row(itemRowType, 222L, 22L),
519 row(addressRowType, 2002L, 2L, "222 2222 st"),
520 };
521 compareRows(expected, cursor);
522 }
523
524 @Test @Ignore
525 public void testOrderToOrderAndAddress()
526 {
527 Operator plan = orderToAddressPlan("tom", true);
528 Cursor cursor = cursor(plan, queryContext, queryBindings);
529 RowBase[] expected = new RowBase[]{
530 row(orderRowType, 21L, 2L, "tom"),
531 row(addressRowType, 2001L, 2L, "222 1111 st"),
532 row(addressRowType, 2002L, 2L, "222 2222 st")
533 };
534 compareRows(expected, cursor);
535 }
536
537 @Test @Ignore
538 public void testItemToItemAndAddress()
539 {
540 Operator plan = itemToAddressPlan(111L, true);
541 Cursor cursor = cursor(plan, queryContext, queryBindings);
542 RowBase[] expected = new RowBase[]{
543 row(itemRowType, 111L, 11L),
544 row(addressRowType, 1001L, 1L, "111 1111 st"),
545 row(addressRowType, 1002L, 1L, "111 2222 st"),
546 };
547 compareRows(expected, cursor);
548 }
549
550 @Test
551 public void testOrderToOrderAndCustomerAndItems()
552 {
553 Operator plan =
554 groupLookup_Default(
555 indexScan_Default(orderSalesmanIndexRowType, false, orderSalesmanEQ("ori")),
556 coi,
557 orderSalesmanIndexRowType,
558 list(orderRowType, customerRowType, itemRowType),
559 InputPreservationOption.DISCARD_INPUT,
560 lookaheadQuantum());
561 Cursor cursor = cursor(plan, queryContext, queryBindings);
562 RowBase[] expected = new RowBase[]{
563 row(customerRowType, 1L, "northbridge"),
564 row(orderRowType, 11L, 1L, "ori"),
565 row(itemRowType, 111L, 11L),
566 row(itemRowType, 112L, 11L),
567 };
568 compareRows(expected, cursor);
569 }
570
571 @Test
572 public void testCustomerToOrderOnly()
573 {
574 Operator plan =
575 groupLookup_Default(
576 indexScan_Default(customerNameIndexRowType, false, customerNameEQ("foundation")),
577 coi,
578 customerNameIndexRowType,
579 list(orderRowType),
580 InputPreservationOption.DISCARD_INPUT,
581 lookaheadQuantum());
582 Cursor cursor = cursor(plan, queryContext, queryBindings);
583 RowBase[] expected = new RowBase[]{
584 row(orderRowType, 21L, 2L, "tom"),
585 row(orderRowType, 22L, 2L, "jack"),
586 };
587 compareRows(expected, cursor);
588 }
589
590 @Test
591 public void testOrderUnionToOrder()
592 {
593 Operator orderOrItem =
594 hKeyUnion_Ordered(
595 indexScan_Default(orderSalesmanIndexRowType, false, orderSalesmanEQ("ori")),
596 indexScan_Default(orderSalesmanIndexRowType, false, orderSalesmanEQ("david")),
597 orderSalesmanIndexRowType,
598 orderSalesmanIndexRowType,
599 2,
600 2,
601 1,
602 customerRowType);
603 Operator plan =
604 groupLookup_Default(
605 orderOrItem,
606 coi,
607 orderOrItem.rowType(),
608 descendants(orderRowType),
609 InputPreservationOption.DISCARD_INPUT,
610 lookaheadQuantum());
611 Cursor cursor = cursor(plan, queryContext, queryBindings);
612 RowBase[] expected = new RowBase[]{
613 row(orderRowType, 11L, 1L, "ori"),
614 row(itemRowType, 111L, 11L),
615 row(itemRowType, 112L, 11L),
616 row(orderRowType, 12L, 1L, "david"),
617 row(itemRowType, 121L, 12L),
618 row(itemRowType, 122L, 12L),
619 };
620 compareRows(expected, cursor);
621 }
622
623 @Test
624 public void testPKAccess() {
625 Operator plan =
626 groupLookup_Default(
627 indexScan_Default(indexType(order, "oid"), false, orderIdEQ(11L)),
628 coi,
629 indexType(order, "oid"),
630 descendants(orderRowType),
631 InputPreservationOption.DISCARD_INPUT,
632 lookaheadQuantum());
633 Cursor cursor = cursor(plan, queryContext, queryBindings);
634 RowBase[] expected = new RowBase[]{
635 row(orderRowType, 11L, 1L, "ori"),
636 row(itemRowType, 111L, 11L),
637 row(itemRowType, 112L, 11L),
638 };
639 compareRows(expected, cursor);
640 }
641
337 @Test642 @Test
338 public void testCursor()643 public void testCursor()
339 {644 {
340 Operator plan =645 Operator plan =
341 ancestorLookup_Default(646 groupLookup_Default(
342 filter_Default(647 filter_Default(
343 groupScan_Default(coi),648 groupScan_Default(coi),
344 Collections.singleton(orderRowType)),649 Collections.singleton(orderRowType)),
345 coi,650 coi,
346 orderRowType,651 orderRowType,
347 Collections.singleton(customerRowType),652 Collections.singleton(customerRowType),
348 InputPreservationOption.DISCARD_INPUT);653 InputPreservationOption.DISCARD_INPUT,
654 lookaheadQuantum());
349 CursorLifecycleTestCase testCase = new CursorLifecycleTestCase()655 CursorLifecycleTestCase testCase = new CursorLifecycleTestCase()
350 {656 {
351 @Override657 @Override
@@ -358,6 +664,11 @@
358 row(customerRowType, 2L, "foundation"),664 row(customerRowType, 2L, "foundation"),
359 };665 };
360 }666 }
667
668 @Override
669 public boolean reopenTopLevel() {
670 return (lookaheadQuantum() > 1);
671 }
361 };672 };
362 testCursorLifecycle(plan, testCase);673 testCursorLifecycle(plan, testCase);
363 }674 }
@@ -367,28 +678,31 @@
367 private Operator indexRowToAncestorPlan(int iid, UserTableRowType ... rowTypes)678 private Operator indexRowToAncestorPlan(int iid, UserTableRowType ... rowTypes)
368 {679 {
369 return680 return
370 ancestorLookup_Default681 groupLookup_Default
371 (indexScan_Default(itemIidIndexRowType, false, itemIidEQ(iid)),682 (indexScan_Default(itemIidIndexRowType, false, itemIidEQ(iid)),
372 coi,683 coi,
373 itemIidIndexRowType,684 itemIidIndexRowType,
374 list(rowTypes),685 list(rowTypes),
375 InputPreservationOption.DISCARD_INPUT);686 InputPreservationOption.DISCARD_INPUT,
687 lookaheadQuantum());
376 }688 }
377689
378 private Operator groupRowToAncestorPlan(int iid, boolean keepInput, UserTableRowType ... rowTypes)690 private Operator groupRowToAncestorPlan(int iid, boolean keepInput, UserTableRowType ... rowTypes)
379 {691 {
380 return692 return
381 ancestorLookup_Default693 groupLookup_Default
382 (branchLookup_Default694 (groupLookup_Default
383 (indexScan_Default(itemIidIndexRowType, false, itemIidEQ(iid)),695 (indexScan_Default(itemIidIndexRowType, false, itemIidEQ(iid)),
384 coi,696 coi,
385 itemIidIndexRowType,697 itemIidIndexRowType,
386 itemRowType,698 list(itemRowType),
387 InputPreservationOption.DISCARD_INPUT),699 InputPreservationOption.DISCARD_INPUT,
700 lookaheadQuantum()),
388 coi,701 coi,
389 itemRowType,702 itemRowType,
390 list(rowTypes),703 list(rowTypes),
391 keepInput ? InputPreservationOption.KEEP_INPUT : InputPreservationOption.DISCARD_INPUT);704 keepInput ? InputPreservationOption.KEEP_INPUT : InputPreservationOption.DISCARD_INPUT,
705 lookaheadQuantum());
392 }706 }
393707
394 private Operator orderHKeyToCustomerAndOrderPlan(String salesman)708 private Operator orderHKeyToCustomerAndOrderPlan(String salesman)
@@ -403,12 +717,105 @@
403 2,717 2,
404 orderRowType);718 orderRowType);
405 return719 return
406 ancestorLookup_Default(720 groupLookup_Default(
407 indexMerge,721 indexMerge,
408 coi,722 coi,
409 indexMerge.rowType(),723 indexMerge.rowType(),
410 Arrays.asList(customerRowType, orderRowType),724 Arrays.asList(customerRowType, orderRowType),
411 InputPreservationOption.DISCARD_INPUT);725 InputPreservationOption.DISCARD_INPUT,
726 lookaheadQuantum());
727 }
728
729 private Operator customerNameToCustomerPlan(String customerName)
730 {
731 return
732 groupLookup_Default(
733 indexScan_Default(customerNameIndexRowType, false, customerNameEQ(customerName)),
734 coi,
735 customerNameIndexRowType,
736 descendants(customerRowType),
737 InputPreservationOption.DISCARD_INPUT,
738 lookaheadQuantum());
739 }
740
741 private Operator addressAddressToCustomerPlan(String address)
742 {
743 return
744 groupLookup_Default(
745 indexScan_Default(addressAddressIndexRowType, false, addressAddressEQ(address)),
746 coi,
747 addressAddressIndexRowType,
748 descendants(customerRowType),
749 InputPreservationOption.DISCARD_INPUT,
750 lookaheadQuantum());
751 }
752
753 private Operator addressToCustomerPlan(String address)
754 {
755 return
756 groupLookup_Default(
757 branchLookup_Default(
758 indexScan_Default(addressAddressIndexRowType, false, addressAddressEQ(address)),
759 coi,
760 addressAddressIndexRowType,
761 addressRowType,
762 InputPreservationOption.DISCARD_INPUT),
763 coi,
764 addressRowType,
765 descendants(customerRowType),
766 InputPreservationOption.DISCARD_INPUT,
767 lookaheadQuantum());
768 }
769
770 private Operator addressToOrderPlan(String address, boolean keepInput)
771 {
772 return
773 groupLookup_Default(
774 ancestorLookup_Default(
775 indexScan_Default(addressAddressIndexRowType, false, addressAddressEQ(address)),
776 coi,
777 addressAddressIndexRowType,
778 Arrays.asList(addressRowType),
779 InputPreservationOption.DISCARD_INPUT),
780 coi,
781 addressRowType,
782 descendants(orderRowType),
783 keepInput ? InputPreservationOption.KEEP_INPUT : InputPreservationOption.DISCARD_INPUT,
784 lookaheadQuantum());
785 }
786
787 private Operator orderToAddressPlan(String salesman, boolean keepInput)
788 {
789 return
790 groupLookup_Default(
791 ancestorLookup_Default(
792 indexScan_Default(orderSalesmanIndexRowType, false, orderSalesmanEQ(salesman)),
793 coi,
794 orderSalesmanIndexRowType,
795 Arrays.asList(orderRowType),
796 InputPreservationOption.DISCARD_INPUT),
797 coi,
798 orderRowType,
799 descendants(addressRowType),
800 keepInput ? InputPreservationOption.KEEP_INPUT : InputPreservationOption.DISCARD_INPUT,
801 lookaheadQuantum());
802 }
803
804 private Operator itemToAddressPlan(long iid, boolean keepInput)
805 {
806 return
807 groupLookup_Default(
808 ancestorLookup_Default(
809 indexScan_Default(itemIidIndexRowType, false, itemIidEQ(iid)),
810 coi,
811 itemIidIndexRowType,
812 Arrays.asList(itemRowType),
813 InputPreservationOption.DISCARD_INPUT),
814 coi,
815 itemRowType,
816 descendants(addressRowType),
817 keepInput ? InputPreservationOption.KEEP_INPUT : InputPreservationOption.DISCARD_INPUT,
818 lookaheadQuantum());
412 }819 }
413820
414 private IndexKeyRange itemIidEQ(int iid)821 private IndexKeyRange itemIidEQ(int iid)
@@ -433,6 +840,67 @@
433 return new IndexBound(row(orderSalesmanIndexRowType, salesman), new SetColumnSelector(0));840 return new IndexBound(row(orderSalesmanIndexRowType, salesman), new SetColumnSelector(0));
434 }841 }
435842
843 private IndexKeyRange customerNameEQ(String name)
844 {
845 IndexBound bound = customerNameIndexBound(name);
846 return IndexKeyRange.bounded(customerNameIndexRowType, bound, true, bound, true);
847 }
848
849 private IndexKeyRange addressAddressEQ(String address)
850 {
851 IndexBound bound = addressAddressIndexBound(address);
852 return IndexKeyRange.bounded(addressAddressIndexRowType, bound, true, bound, true);
853 }
854
855 private IndexKeyRange orderSalesmanEQ(String salesman)
856 {
857 IndexBound bound = orderSalesmanIndexBound(salesman);
858 return IndexKeyRange.bounded(orderSalesmanIndexRowType, bound, true, bound, true);
859 }
860
861 private IndexKeyRange orderIdEQ(long oid)
862 {
863 IndexRowType indexRowType = indexType(order, "oid");
864 IndexBound bound = new IndexBound(row(indexRowType, oid), new SetColumnSelector(0));
865 return IndexKeyRange.bounded(indexRowType, bound, true, bound, true);
866
867 }
868 private IndexKeyRange itemIidEQ(long iid)
869 {
870 IndexBound bound = itemIidIndexBound(iid);
871 return IndexKeyRange.bounded(itemIidIndexRowType, bound, true, bound, true);
872 }
873
874 private IndexBound customerNameIndexBound(String name)
875 {
876 return new IndexBound(row(customerNameIndexRowType, name), new SetColumnSelector(0));
877 }
878
879 private IndexBound addressAddressIndexBound(String addr)
880 {
881 return new IndexBound(row(addressAddressIndexRowType, addr), new SetColumnSelector(0));
882 }
883
884 private IndexBound orderSalesmanIndexBound(String salesman)
885 {
886 return new IndexBound(row(orderSalesmanIndexRowType, salesman), new SetColumnSelector(0));
887 }
888
889 private IndexBound itemIidIndexBound(long iid)
890 {
891 return new IndexBound(row(itemIidIndexRowType, iid), new SetColumnSelector(0));
892 }
893
894 private List<UserTableRowType> descendants(UserTableRowType root)
895 {
896 List<UserTableRowType> result = new ArrayList<>();
897 result.add(root);
898 for (RowType rowType : Schema.descendentTypes(root, schema.userTableTypes())) {
899 result.add((UserTableRowType)rowType);
900 }
901 return result;
902 }
903
436 private List<UserTableRowType> list(UserTableRowType... rowTypes)904 private List<UserTableRowType> list(UserTableRowType... rowTypes)
437 {905 {
438 return Arrays.asList(rowTypes);906 return Arrays.asList(rowTypes);
439907
=== renamed file 'src/test/java/com/akiban/server/test/it/qp/GroupLookupLookaheadIT.java' => 'src/test/java/com/akiban/server/test/it/qp/GroupLookup_DefaultLookaheadIT.java'
--- src/test/java/com/akiban/server/test/it/qp/GroupLookupLookaheadIT.java 2013-07-13 21:17:31 +0000
+++ src/test/java/com/akiban/server/test/it/qp/GroupLookup_DefaultLookaheadIT.java 2013-07-24 22:52:24 +0000
@@ -54,87 +54,32 @@
54import static com.akiban.qp.operator.API.*;54import static com.akiban.qp.operator.API.*;
55import static com.akiban.server.test.ExpressionGenerators.*;55import static com.akiban.server.test.ExpressionGenerators.*;
5656
57public class GroupLookupLookaheadIT extends OperatorITBase57public class GroupLookup_DefaultLookaheadIT extends GroupLookup_DefaultIT
58{58{
59 protected void moreDB() {
60 NewRow[] daves = new NewRow[]{
61 createNewRow(order, 23L, 2L, "dave"),
62 createNewRow(order, 24L, 2L, "dave"),
63 createNewRow(order, 25L, 2L, "dave")};
64 writeRows(daves);
65 }
66
59 @Override67 @Override
60 protected boolean pipelineMap() {68 protected boolean pipelineMap() {
61 return true;69 return true;
62 }70 }
6371
72 @Override
64 protected int lookaheadQuantum() {73 protected int lookaheadQuantum() {
65 return 4;74 return 4;
66 }75 }
6776
68 @Override
69 protected void setupPostCreateSchema() {
70 super.setupPostCreateSchema();
71 NewRow[] dbWithOrphans = new NewRow[]{
72 createNewRow(customer, 1L, "northbridge"),
73 createNewRow(customer, 2L, "foundation"),
74 createNewRow(order, 11L, 1L, "ori"),
75 createNewRow(order, 12L, 1L, "david"),
76 createNewRow(order, 21L, 2L, "tom"),
77 createNewRow(order, 22L, 2L, "jack"),
78 createNewRow(order, 23L, 2L, "dave"),
79 createNewRow(order, 24L, 2L, "dave"),
80 createNewRow(order, 25L, 2L, "dave"),
81 createNewRow(order, 31L, 3L, "peter"),
82 createNewRow(item, 111L, 11L),
83 createNewRow(item, 112L, 11L),
84 createNewRow(item, 121L, 12L),
85 createNewRow(item, 122L, 12L),
86 createNewRow(item, 211L, 21L),
87 createNewRow(item, 212L, 21L),
88 createNewRow(item, 221L, 22L),
89 createNewRow(item, 222L, 22L),
90 // orphans
91 createNewRow(item, 311L, 31L),
92 createNewRow(item, 312L, 31L)};
93 use(dbWithOrphans);
94 }
95
96 @Test77 @Test
97 public void testAncestorLookupCursor()
98 {
99 Operator plan =
100 ancestorLookup_Default(
101 filter_Default(
102 groupScan_Default(coi),
103 Collections.singleton(orderRowType)),
104 coi,
105 orderRowType,
106 Collections.singleton(customerRowType),
107 InputPreservationOption.DISCARD_INPUT,
108 lookaheadQuantum());
109 CursorLifecycleTestCase testCase = new CursorLifecycleTestCase()
110 {
111 @Override
112 public RowBase[] firstExpectedRows()
113 {
114 return new RowBase[] {
115 row(customerRowType, 1L, "northbridge"),
116 row(customerRowType, 1L, "northbridge"),
117 row(customerRowType, 2L, "foundation"),
118 row(customerRowType, 2L, "foundation"),
119 row(customerRowType, 2L, "foundation"),
120 row(customerRowType, 2L, "foundation"),
121 row(customerRowType, 2L, "foundation"),
122 };
123 }
124
125 @Override
126 public boolean reopenTopLevel() {
127 return true;
128 }
129 };
130 testCursorLifecycle(plan, testCase);
131 }
132
133 @Test @Ignore // Same check in testCursor
134 public void testAncestorLookupSimple()78 public void testAncestorLookupSimple()
135 {79 {
80 moreDB();
136 Operator plan =81 Operator plan =
137 ancestorLookup_Default(82 groupLookup_Default(
138 filter_Default(83 filter_Default(
139 groupScan_Default(coi),84 groupScan_Default(coi),
140 Collections.singleton(orderRowType)),85 Collections.singleton(orderRowType)),
@@ -148,6 +93,9 @@
148 row(customerRowType, 1L, "northbridge"),93 row(customerRowType, 1L, "northbridge"),
149 row(customerRowType, 2L, "foundation"),94 row(customerRowType, 2L, "foundation"),
150 row(customerRowType, 2L, "foundation"),95 row(customerRowType, 2L, "foundation"),
96 row(customerRowType, 2L, "foundation"),
97 row(customerRowType, 2L, "foundation"),
98 row(customerRowType, 2L, "foundation"),
151 };99 };
152 compareRows(expected, cursor(plan, queryContext, queryBindings));100 compareRows(expected, cursor(plan, queryContext, queryBindings));
153 }101 }
@@ -155,6 +103,7 @@
155 @Test103 @Test
156 public void testAncestorLookupMap()104 public void testAncestorLookupMap()
157 {105 {
106 moreDB();
158 RowType cidValueRowType = schema.newValuesType(AkType.INT);107 RowType cidValueRowType = schema.newValuesType(AkType.INT);
159 List<ExpressionGenerator> cidExprs = Arrays.asList(boundField(cidValueRowType, 1, 0));108 List<ExpressionGenerator> cidExprs = Arrays.asList(boundField(cidValueRowType, 1, 0));
160 IndexBound cidBound =109 IndexBound cidBound =
@@ -169,7 +118,7 @@
169 intRow(cidValueRowType, 2),118 intRow(cidValueRowType, 2),
170 intRow(cidValueRowType, 10)),119 intRow(cidValueRowType, 10)),
171 cidValueRowType),120 cidValueRowType),
172 ancestorLookup_Default(121 groupLookup_Default(
173 indexScan_Default(orderCidIndexRowType, cidRange, ordering(orderCidIndexRowType), IndexScanSelector.leftJoinAfter(orderCidIndexRowType.index(), orderRowType.userTable()), lookaheadQuantum()),122 indexScan_Default(orderCidIndexRowType, cidRange, ordering(orderCidIndexRowType), IndexScanSelector.leftJoinAfter(orderCidIndexRowType.index(), orderRowType.userTable()), lookaheadQuantum()),
174 coi,123 coi,
175 orderCidIndexRowType,124 orderCidIndexRowType,
176125
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/cbo/duplicate-child.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/cbo/duplicate-child.expected 2012-08-29 13:38:58 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/cbo/duplicate-child.expected 2013-07-24 22:52:24 +0000
@@ -3,6 +3,6 @@
3 Filter_Default(customers - orders)3 Filter_Default(customers - orders)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 Select_HKeyOrdered(o2.order_date == DATE '2011-03-02')5 Select_HKeyOrdered(o2.order_date == DATE '2011-03-02')
6 BranchLookup_Default(customers -> orders)6 GroupLookup_Default(customers -> orders)
7 AncestorLookup_Default(Index(orders.order_date) -> customers)7 GroupLookup_Default(Index(orders.order_date) -> customers)
8 IndexScan_Default(Index(orders.order_date), order_date = DATE '2011-03-01')8 IndexScan_Default(Index(orders.order_date), order_date = DATE '2011-03-01')
9\ No newline at end of file9\ No newline at end of file
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-multi-branch.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-multi-branch.expected 2012-08-29 13:38:58 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-multi-branch.expected 2013-07-24 22:52:24 +0000
@@ -3,8 +3,8 @@
3 Filter_Default(customers - addresses)3 Filter_Default(customers - addresses)
4 Flatten_HKeyOrdered(customers INNER addresses)4 Flatten_HKeyOrdered(customers INNER addresses)
5 Select_HKeyOrdered(addresses.state == 'CA')5 Select_HKeyOrdered(addresses.state == 'CA')
6 BranchLookup_Default(customers -> addresses)6 GroupLookup_Default(customers -> addresses)
7 AncestorLookup_Default(Index(orders.order_date) -> customers)7 GroupLookup_Default(Index(orders.order_date) -> customers)
8 Intersect_Ordered(skip 1 left, skip 1 right, compare 1)8 Intersect_Ordered(skip 1 left, skip 1 right, compare 1)
9 IndexScan_Default(Index(orders.order_date), order_date = DATE '2010-04-22')9 IndexScan_Default(Index(orders.order_date), order_date = DATE '2010-04-22')
10 IndexScan_Default(Index(addresses.state), state = 'CA')10 IndexScan_Default(Index(addresses.state), state = 'CA')
11\ No newline at end of file11\ No newline at end of file
1212
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-multi-duplicate.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-multi-duplicate.expected 2013-07-17 21:00:35 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-multi-duplicate.expected 2013-07-24 22:52:24 +0000
@@ -3,7 +3,7 @@
3 Map_NestedLoops()3 Map_NestedLoops()
4 Flatten_HKeyOrdered(customers - orders INNER items)4 Flatten_HKeyOrdered(customers - orders INNER items)
5 Flatten_HKeyOrdered(customers INNER orders)5 Flatten_HKeyOrdered(customers INNER orders)
6 AncestorLookup_Default(Index(items.sku) -> customers, orders, items)6 GroupLookup_Default(Index(items.sku) -> customers, orders, items)
7 Intersect_Ordered(skip 1 left, skip 1 right, compare 1)7 Intersect_Ordered(skip 1 left, skip 1 right, compare 1)
8 IndexScan_Default(Index(items.sku), sku = '1234')8 IndexScan_Default(Index(items.sku), sku = '1234')
9 IndexScan_Default(Index(items.sku), sku = '4567')9 IndexScan_Default(Index(items.sku), sku = '4567')
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-multi-ordered.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-multi-ordered.expected 2013-07-17 21:00:35 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-multi-ordered.expected 2013-07-24 22:52:24 +0000
@@ -3,7 +3,7 @@
3 Map_NestedLoops()3 Map_NestedLoops()
4 Flatten_HKeyOrdered(customers - orders INNER items)4 Flatten_HKeyOrdered(customers - orders INNER items)
5 Flatten_HKeyOrdered(customers INNER orders)5 Flatten_HKeyOrdered(customers INNER orders)
6 AncestorLookup_Default(Index(items.sku) -> customers, orders, items)6 GroupLookup_Default(Index(items.sku) -> customers, orders, items)
7 Intersect_Ordered(skip 1 left, skip 1 right, compare 1)7 Intersect_Ordered(skip 1 left, skip 1 right, compare 1)
8 IndexScan_Default(Index(items.sku), sku = '1234', orders.cid DESC, oid, iid)8 IndexScan_Default(Index(items.sku), sku = '1234', orders.cid DESC, oid, iid)
9 IndexScan_Default(Index(items.sku), sku = '4567', orders.cid DESC, oid, iid)9 IndexScan_Default(Index(items.sku), sku = '4567', orders.cid DESC, oid, iid)
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-single-branch.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-single-branch.expected 2012-08-29 13:38:58 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiindex-single-branch.expected 2013-07-24 22:52:24 +0000
@@ -1,7 +1,7 @@
1PhysicalSelect[cid:int[INT], name:varchar(32)[VARCHAR], aid:int[INT], cid:int[INT], state:char(2)[VARCHAR], city:varchar(100)[VARCHAR]]1PhysicalSelect[cid:int[INT], name:varchar(32)[VARCHAR], aid:int[INT], cid:int[INT], state:char(2)[VARCHAR], city:varchar(100)[VARCHAR]]
2 Project_Default(customers.cid, customers.name, addresses.aid, addresses.cid, addresses.state, addresses.city)2 Project_Default(customers.cid, customers.name, addresses.aid, addresses.cid, addresses.state, addresses.city)
3 Flatten_HKeyOrdered(customers INNER addresses)3 Flatten_HKeyOrdered(customers INNER addresses)
4 AncestorLookup_Default(Index(addresses.state) -> customers, addresses)4 GroupLookup_Default(Index(addresses.state) -> customers, addresses)
5 Intersect_Ordered(skip 1 left, skip 1 right, compare 1)5 Intersect_Ordered(skip 1 left, skip 1 right, compare 1)
6 IndexScan_Default(Index(addresses.state), state = 'CA')6 IndexScan_Default(Index(addresses.state), state = 'CA')
7 IndexScan_Default(Index(customers.name), name = 'Awwyqrezr')7 IndexScan_Default(Index(customers.name), name = 'Awwyqrezr')
8\ No newline at end of file8\ No newline at end of file
99
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-1.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-1.expected 2013-07-17 21:00:35 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-1.expected 2013-07-24 22:52:24 +0000
@@ -1,12 +1,12 @@
1PhysicalSelect[cid:int[INT]]1PhysicalSelect[cid:int[INT]]
2 Map_NestedLoops()2 Map_NestedLoops()
3 AncestorLookup_Default(Index(parent.PRIMARY) -> parent)3 GroupLookup_Default(Index(parent.PRIMARY) -> parent)
4 IndexScan_Default(Index(parent.PRIMARY), id > 1)4 IndexScan_Default(Index(parent.PRIMARY), id > 1)
5 Project_Default(customers.cid)5 Project_Default(customers.cid)
6 Map_NestedLoops()6 Map_NestedLoops()
7 Flatten_HKeyOrdered(customers INNER items)7 Flatten_HKeyOrdered(customers INNER items)
8 Select_HKeyOrdered(items.quan > 100)8 Select_HKeyOrdered(items.quan > 100)
9 AncestorLookup_Default(Index(customers.cname_and_sku) -> customers, items)9 GroupLookup_Default(Index(customers.cname_and_sku) -> customers, items)
10 IndexScan_Default(Index(customers.cname_and_sku), customers.name = parent.name, items.sku = '1234')10 IndexScan_Default(Index(customers.cname_and_sku), customers.name = parent.name, items.sku = '1234')
11 Product_Nested(customers - items x customers - addresses)11 Product_Nested(customers - items x customers - addresses)
12 Select_HKeyOrdered(addresses.city != customers.name)12 Select_HKeyOrdered(addresses.city != customers.name)
1313
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-1.t3expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-1.t3expected 2013-07-17 21:00:35 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-1.t3expected 2013-07-24 22:52:24 +0000
@@ -1,12 +1,12 @@
1PhysicalSelect[cid:int[INT]]1PhysicalSelect[cid:int[INT]]
2 Map_NestedLoops()2 Map_NestedLoops()
3 AncestorLookup_Default(Index(parent.PRIMARY) -> parent)3 GroupLookup_Default(Index(parent.PRIMARY) -> parent)
4 IndexScan_Default(Index(parent.PRIMARY), id > 1)4 IndexScan_Default(Index(parent.PRIMARY), id > 1)
5 Project_Default(customers.cid)5 Project_Default(customers.cid)
6 Map_NestedLoops()6 Map_NestedLoops()
7 Flatten_HKeyOrdered(customers INNER items)7 Flatten_HKeyOrdered(customers INNER items)
8 Select_HKeyOrdered(items.quan > 100)8 Select_HKeyOrdered(items.quan > 100)
9 AncestorLookup_Default(Index(customers.cname_and_sku) -> customers, items)9 GroupLookup_Default(Index(customers.cname_and_sku) -> customers, items)
10 IndexScan_Default(Index(customers.cname_and_sku), customers.name = parent.name, items.sku = '1234')10 IndexScan_Default(Index(customers.cname_and_sku), customers.name = parent.name, items.sku = '1234')
11 Product_Nested(customers - items x customers - addresses)11 Product_Nested(customers - items x customers - addresses)
12 Select_HKeyOrdered(addresses.city != customers.name)12 Select_HKeyOrdered(addresses.city != customers.name)
1313
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-2.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-2.expected 2012-08-29 13:38:58 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-2.expected 2013-07-24 22:52:24 +0000
@@ -6,6 +6,6 @@
6 IndexScan_Default(Index(customers.name), name = parent.name)6 IndexScan_Default(Index(customers.name), name = parent.name)
7 Project_Default(customers.name)7 Project_Default(customers.name)
8 Select_HKeyOrdered(parent.name != addresses.city)8 Select_HKeyOrdered(parent.name != addresses.city)
9 AncestorLookup_Default(Index(addresses.state) -> addresses)9 GroupLookup_Default(Index(addresses.state) -> addresses)
10 Select_HKeyOrdered((addresses.state != customers.name) AND (addresses.state != 'WY'))10 Select_HKeyOrdered((addresses.state != customers.name) AND (addresses.state != 'WY'))
11 IndexScan_Default(Index(addresses.state), state > 'M')11 IndexScan_Default(Index(addresses.state), state > 'M')
12\ No newline at end of file12\ No newline at end of file
1313
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-2.t3expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-2.t3expected 2012-10-05 00:49:38 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/cbo/multiple-table-conds-2.t3expected 2013-07-24 22:52:24 +0000
@@ -6,6 +6,6 @@
6 IndexScan_Default(Index(customers.name), name = parent.name)6 IndexScan_Default(Index(customers.name), name = parent.name)
7 Project_Default(customers.name)7 Project_Default(customers.name)
8 Select_HKeyOrdered(parent.name != addresses.city)8 Select_HKeyOrdered(parent.name != addresses.city)
9 AncestorLookup_Default(Index(addresses.state) -> addresses)9 GroupLookup_Default(Index(addresses.state) -> addresses)
10 Select_HKeyOrdered((addresses.state != customers.name) AND (addresses.state != 'WY'))10 Select_HKeyOrdered((addresses.state != customers.name) AND (addresses.state != 'WY'))
11 IndexScan_Default(Index(addresses.state), state > 'M')11 IndexScan_Default(Index(addresses.state), state > 'M')
12\ No newline at end of file12\ No newline at end of file
1313
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/cbo/subquery-join-1.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/cbo/subquery-join-1.expected 2012-08-29 13:38:58 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/cbo/subquery-join-1.expected 2013-07-24 22:52:24 +0000
@@ -5,5 +5,5 @@
5 IfEmpty_Default(NULL, NULL)5 IfEmpty_Default(NULL, NULL)
6 Project_Default(orders.cid, orders.order_date)6 Project_Default(orders.cid, orders.order_date)
7 Select_HKeyOrdered(orders.order_date < DATE '2011-01-01')7 Select_HKeyOrdered(orders.order_date < DATE '2011-01-01')
8 AncestorLookup_Default(Index(orders.__akiban_fk_0) -> orders)8 GroupLookup_Default(Index(orders.__akiban_fk_0) -> orders)
9 IndexScan_Default(Index(orders.__akiban_fk_0), cid = c.cid)9 IndexScan_Default(Index(orders.__akiban_fk_0), cid = c.cid)
10\ No newline at end of file10\ No newline at end of file
1111
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/cbo/subquery-join-1.t3expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/cbo/subquery-join-1.t3expected 2012-10-02 13:14:54 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/cbo/subquery-join-1.t3expected 2013-07-24 22:52:24 +0000
@@ -5,5 +5,5 @@
5 IfEmpty_Default(NULL, NULL)5 IfEmpty_Default(NULL, NULL)
6 Project_Default(orders.cid, orders.order_date)6 Project_Default(orders.cid, orders.order_date)
7 Select_HKeyOrdered(orders.order_date < DATE '2011-01-01')7 Select_HKeyOrdered(orders.order_date < DATE '2011-01-01')
8 AncestorLookup_Default(Index(orders.__akiban_fk_0) -> orders)8 GroupLookup_Default(Index(orders.__akiban_fk_0) -> orders)
9 IndexScan_Default(Index(orders.__akiban_fk_0), cid = c.cid)9 IndexScan_Default(Index(orders.__akiban_fk_0), cid = c.cid)
10\ No newline at end of file10\ No newline at end of file
1111
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/cbo/subquery-join-2.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/cbo/subquery-join-2.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/cbo/subquery-join-2.expected 2013-07-24 22:52:24 +0000
@@ -3,5 +3,5 @@
3 ValuesScan_Default(['1234'], ['9876'])3 ValuesScan_Default(['1234'], ['9876'])
4 Project_Default(orders.order_date, items.quan)4 Project_Default(orders.order_date, items.quan)
5 Flatten_HKeyOrdered(orders INNER items)5 Flatten_HKeyOrdered(orders INNER items)
6 AncestorLookup_Default(Index(customers.sku_and_date) -> orders, items)6 GroupLookup_Default(Index(customers.sku_and_date) -> orders, items)
7 IndexScan_Default(Index(customers.sku_and_date), items.sku = Bound(0, 0), orders.order_date < DATE '2011-01-01')7 IndexScan_Default(Index(customers.sku_and_date), items.sku = Bound(0, 0), orders.order_date < DATE '2011-01-01')
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/cbo/three-groups.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/cbo/three-groups.expected 2012-08-29 13:38:58 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/cbo/three-groups.expected 2013-07-24 22:52:24 +0000
@@ -4,8 +4,8 @@
4 GroupScan_Default(parent)4 GroupScan_Default(parent)
5 Map_NestedLoops()5 Map_NestedLoops()
6 Flatten_HKeyOrdered(customers INNER orders)6 Flatten_HKeyOrdered(customers INNER orders)
7 AncestorLookup_Default(Index(orders.PRIMARY) -> customers, orders)7 GroupLookup_Default(Index(orders.PRIMARY) -> customers, orders)
8 IndexScan_Default(Index(orders.PRIMARY), oid = child.pid)8 IndexScan_Default(Index(orders.PRIMARY), oid = child.pid)
9 Project_Default(customers.cid, customers.name, orders.oid, orders.cid, orders.order_date, child.id, child.pid, child.name, items.iid, items.oid, items.sku, items.quan)9 Project_Default(customers.cid, customers.name, orders.oid, orders.cid, orders.order_date, child.id, child.pid, child.name, items.iid, items.oid, items.sku, items.quan)
10 AncestorLookup_Default(Index(items.__akiban_fk_1) -> items)10 GroupLookup_Default(Index(items.__akiban_fk_1) -> items)
11 IndexScan_Default(Index(items.__akiban_fk_1), oid = child.id, orders.cid, iid)11 IndexScan_Default(Index(items.__akiban_fk_1), oid = child.id, orders.cid, iid)
12\ No newline at end of file12\ No newline at end of file
1313
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/count-3.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/count-3.expected 2012-09-27 21:19:38 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/count-3.expected 2013-07-24 22:52:24 +0000
@@ -4,5 +4,5 @@
4 Flatten_HKeyOrdered(customers - orders INNER items)4 Flatten_HKeyOrdered(customers - orders INNER items)
5 Flatten_HKeyOrdered(customers INNER orders)5 Flatten_HKeyOrdered(customers INNER orders)
6 Select_HKeyOrdered(items.quan == 100)6 Select_HKeyOrdered(items.quan == 100)
7 AncestorLookup_Default(Index(items.sku) -> customers, orders, items)7 GroupLookup_Default(Index(items.sku) -> customers, orders, items)
8 IndexScan_Default(Index(items.sku), sku < '8888')8 IndexScan_Default(Index(items.sku), sku < '8888')
9\ No newline at end of file9\ No newline at end of file
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/count-3.t3expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/count-3.t3expected 2012-10-02 13:14:54 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/count-3.t3expected 2013-07-24 22:52:24 +0000
@@ -4,5 +4,5 @@
4 Flatten_HKeyOrdered(customers - orders INNER items)4 Flatten_HKeyOrdered(customers - orders INNER items)
5 Flatten_HKeyOrdered(customers INNER orders)5 Flatten_HKeyOrdered(customers INNER orders)
6 Select_HKeyOrdered(items.quan == 100)6 Select_HKeyOrdered(items.quan == 100)
7 AncestorLookup_Default(Index(items.sku) -> customers, orders, items)7 GroupLookup_Default(Index(items.sku) -> customers, orders, items)
8 IndexScan_Default(Index(items.sku), sku < '8888')8 IndexScan_Default(Index(items.sku), sku < '8888')
9\ No newline at end of file9\ No newline at end of file
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/delete-1.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/delete-1.expected 2012-09-26 01:25:08 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/delete-1.expected 2013-07-24 22:52:24 +0000
@@ -1,4 +1,4 @@
1PhysicalUpdate1PhysicalUpdate
2 Delete_Returning(FROM items)2 Delete_Returning(FROM items)
3 AncestorLookup_Default(Index(items.PRIMARY) -> items)3 GroupLookup_Default(Index(items.PRIMARY) -> items)
4 IndexScan_Default(Index(items.PRIMARY), iid = 1012)4 IndexScan_Default(Index(items.PRIMARY), iid = 1012)
5\ No newline at end of file5\ No newline at end of file
66
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-0.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-0.expected 2012-08-26 04:29:21 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-0.expected 2013-07-24 22:52:24 +0000
@@ -1,4 +1,4 @@
1PhysicalSelect[name:varchar(32)[VARCHAR]]1PhysicalSelect[name:varchar(32)[VARCHAR]]
2 Project_Default(customers.name)2 Project_Default(customers.name)
3 AncestorLookup_Default(Index(customers.PRIMARY) -> customers)3 GroupLookup_Default(Index(customers.PRIMARY) -> customers)
4 IndexScan_Default(Index(customers.PRIMARY), cid = 1)4 IndexScan_Default(Index(customers.PRIMARY), cid = 1)
5\ No newline at end of file5\ No newline at end of file
66
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02a.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02a.expected 2012-08-29 13:38:58 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02a.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(items.sku) -> customers, orders, items)5 GroupLookup_Default(Index(items.sku) -> customers, orders, items)
6 IndexScan_Default(Index(items.sku), sku = '1234')6 IndexScan_Default(Index(items.sku), sku = '1234')
7\ No newline at end of file7\ No newline at end of file
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02b.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02b.expected 2012-08-29 13:38:58 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02b.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(items.sku) -> customers, orders, items)5 GroupLookup_Default(Index(items.sku) -> customers, orders, items)
6 IndexScan_Default(Index(items.sku), sku >= '0' AND < '8888')6 IndexScan_Default(Index(items.sku), sku >= '0' AND < '8888')
7\ No newline at end of file7\ No newline at end of file
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02p.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02p.expected 2012-08-29 13:38:58 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02p.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(items.sku) -> customers, orders, items)5 GroupLookup_Default(Index(items.sku) -> customers, orders, items)
6 IndexScan_Default(Index(items.sku), sku < $1)6 IndexScan_Default(Index(items.sku), sku < $1)
7\ No newline at end of file7\ No newline at end of file
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02r.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02r.expected 2012-08-29 13:38:58 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-02r.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(items.sku) -> customers, orders, items)5 GroupLookup_Default(Index(items.sku) -> customers, orders, items)
6 IndexScan_Default(Index(items.sku), sku < '8888')6 IndexScan_Default(Index(items.sku), sku < '8888')
7\ No newline at end of file7\ No newline at end of file
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-07o.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-07o.expected 2012-08-29 13:38:58 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-07o.expected 2013-07-24 22:52:24 +0000
@@ -1,5 +1,5 @@
1PhysicalSelect[order_date:date[DATE]]1PhysicalSelect[order_date:date[DATE]]
2 Project_Default(orders.order_date)2 Project_Default(orders.order_date)
3 Flatten_HKeyOrdered(customers INNER orders)3 Flatten_HKeyOrdered(customers INNER orders)
4 AncestorLookup_Default(Index(orders.order_date) -> customers, orders)4 GroupLookup_Default(Index(orders.order_date) -> customers, orders)
5 IndexScan_Default(Index(orders.order_date), order_date > DATE '2011-01-01')5 IndexScan_Default(Index(orders.order_date), order_date > DATE '2011-01-01')
6\ No newline at end of file6\ No newline at end of file
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-10.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-10.expected 2012-12-31 22:39:46 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-10.expected 2013-07-24 22:52:24 +0000
@@ -1,5 +1,5 @@
1PhysicalSelect[oid:int[INT], sku:varchar(32)[VARCHAR], quan:int[INT]]1PhysicalSelect[oid:int[INT], sku:varchar(32)[VARCHAR], quan:int[INT]]
2 Project_Default(items.oid, items.sku, items.quan)2 Project_Default(items.oid, items.sku, items.quan)
3 Select_HKeyOrdered(in(items.quan, 100, 200, 300))3 Select_HKeyOrdered(in(items.quan, 100, 200, 300))
4 AncestorLookup_Default(Index(items.sku) -> items)4 GroupLookup_Default(Index(items.sku) -> items)
5 IndexScan_Default(Index(items.sku), sku ASC, orders.cid, oid, iid)5 IndexScan_Default(Index(items.sku), sku ASC, orders.cid, oid, iid)
6\ No newline at end of file6\ No newline at end of file
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-11.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-11.expected 2012-08-28 17:36:05 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-11.expected 2013-07-24 22:52:24 +0000
@@ -3,8 +3,8 @@
3 Project_Default(Field(0), Field(1))3 Project_Default(Field(0), Field(1))
4 Aggregate_Partial(GROUP BY cid: MAX)4 Aggregate_Partial(GROUP BY cid: MAX)
5 Project_Default(orders.cid, orders.order_date)5 Project_Default(orders.cid, orders.order_date)
6 AncestorLookup_Default(Index(orders.__akiban_fk_0) -> orders)6 GroupLookup_Default(Index(orders.__akiban_fk_0) -> orders)
7 IndexScan_Default(Index(orders.__akiban_fk_0), cid ASC)7 IndexScan_Default(Index(orders.__akiban_fk_0), cid ASC)
8 Project_Default(customers.name, Bound(0, 1))8 Project_Default(customers.name, Bound(0, 1))
9 AncestorLookup_Default(Index(customers.PRIMARY) -> customers)9 GroupLookup_Default(Index(customers.PRIMARY) -> customers)
10 IndexScan_Default(Index(customers.PRIMARY), cid = Bound(0, 0))10 IndexScan_Default(Index(customers.PRIMARY), cid = Bound(0, 0))
11\ No newline at end of file11\ No newline at end of file
1212
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-11.t3expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-11.t3expected 2012-10-02 13:14:54 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-11.t3expected 2013-07-24 22:52:24 +0000
@@ -3,8 +3,8 @@
3 Project_Default(Field(0), Field(1))3 Project_Default(Field(0), Field(1))
4 Aggregate_Partial(GROUP BY cid: MAX)4 Aggregate_Partial(GROUP BY cid: MAX)
5 Project_Default(orders.cid, orders.order_date)5 Project_Default(orders.cid, orders.order_date)
6 AncestorLookup_Default(Index(orders.__akiban_fk_0) -> orders)6 GroupLookup_Default(Index(orders.__akiban_fk_0) -> orders)
7 IndexScan_Default(Index(orders.__akiban_fk_0), cid ASC)7 IndexScan_Default(Index(orders.__akiban_fk_0), cid ASC)
8 Project_Default(customers.name, Bound(0, 1))8 Project_Default(customers.name, Bound(0, 1))
9 AncestorLookup_Default(Index(customers.PRIMARY) -> customers)9 GroupLookup_Default(Index(customers.PRIMARY) -> customers)
10 IndexScan_Default(Index(customers.PRIMARY), cid = Bound(0, 0))10 IndexScan_Default(Index(customers.PRIMARY), cid = Bound(0, 0))
11\ No newline at end of file11\ No newline at end of file
1212
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-14.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-14.expected 2012-11-15 23:51:50 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-14.expected 2013-07-24 22:52:24 +0000
@@ -1,7 +1,7 @@
1PhysicalSelect[order_date:date[DATE]]1PhysicalSelect[order_date:date[DATE]]
2 Map_NestedLoops()2 Map_NestedLoops()
3 Filter_Default(orders)3 Filter_Default(orders)
4 BranchLookup_Default(Index(customers.name) -> customers)4 GroupLookup_Default(Index(customers.name) -> orders)
5 IndexScan_Default(Index(customers.name), name = 'Smith')5 IndexScan_Default(Index(customers.name), name = 'Smith')
6 Project_Default(orders.order_date)6 Project_Default(orders.order_date)
7 IfEmpty_Default(NULL, NULL, NULL, NULL, DISCARD_INPUT)7 IfEmpty_Default(NULL, NULL, NULL, NULL, DISCARD_INPUT)
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-15.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-15.expected 2012-11-21 20:30:27 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-15.expected 2013-07-24 22:52:24 +0000
@@ -1,7 +1,7 @@
1PhysicalSelect[oid:int[INT], cid:int[INT], order_date:date[DATE], iid:int[INT], oid:int[INT], sku:varchar(32)[VARCHAR], quan:int[INT]]1PhysicalSelect[oid:int[INT], cid:int[INT], order_date:date[DATE], iid:int[INT], oid:int[INT], sku:varchar(32)[VARCHAR], quan:int[INT]]
2 Project_Default(orders.oid, orders.cid, orders.order_date, items.iid, items.oid, items.sku, items.quan)2 Project_Default(orders.oid, orders.cid, orders.order_date, items.iid, items.oid, items.sku, items.quan)
3 Flatten_HKeyOrdered(orders INNER items)3 Flatten_HKeyOrdered(orders INNER items)
4 AncestorLookup_Default(Index(items.sku) -> orders, items)4 GroupLookup_Default(Index(items.sku) -> orders, items)
5 Intersect_Ordered(skip 1 left, skip 1 right, compare 2)5 Intersect_Ordered(skip 1 left, skip 1 right, compare 2)
6 Union_Ordered(all, skip 1, compare 3)6 Union_Ordered(all, skip 1, compare 3)
7 IndexScan_Default(Index(items.sku), sku = '1234', orders.cid ASC, oid, iid)7 IndexScan_Default(Index(items.sku), sku = '1234', orders.cid ASC, oid, iid)
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-15a.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-15a.expected 2012-11-23 19:13:43 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-15a.expected 2013-07-24 22:52:24 +0000
@@ -1,7 +1,7 @@
1PhysicalSelect[oid:int[INT], cid:int[INT], order_date:date[DATE], iid:int[INT], oid:int[INT], sku:varchar(32)[VARCHAR], quan:int[INT]]1PhysicalSelect[oid:int[INT], cid:int[INT], order_date:date[DATE], iid:int[INT], oid:int[INT], sku:varchar(32)[VARCHAR], quan:int[INT]]
2 Project_Default(orders.oid, orders.cid, orders.order_date, items.iid, items.oid, items.sku, items.quan)2 Project_Default(orders.oid, orders.cid, orders.order_date, items.iid, items.oid, items.sku, items.quan)
3 Flatten_HKeyOrdered(orders INNER items)3 Flatten_HKeyOrdered(orders INNER items)
4 AncestorLookup_Default(Index(items.PRIMARY) -> orders, items)4 GroupLookup_Default(Index(items.PRIMARY) -> orders, items)
5 Intersect_Ordered(skip 1 left, skip 1 right, compare 2)5 Intersect_Ordered(skip 1 left, skip 1 right, compare 2)
6 Union_Ordered(all, skip 1, compare 2)6 Union_Ordered(all, skip 1, compare 2)
7 IndexScan_Default(Index(items.PRIMARY), iid = 100, orders.cid ASC, oid)7 IndexScan_Default(Index(items.PRIMARY), iid = 100, orders.cid ASC, oid)
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-15i.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-15i.expected 2012-11-21 20:30:27 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-15i.expected 2013-07-24 22:52:24 +0000
@@ -1,7 +1,7 @@
1PhysicalSelect[oid:int[INT], cid:int[INT], order_date:date[DATE], iid:int[INT], oid:int[INT], sku:varchar(32)[VARCHAR], quan:int[INT]]1PhysicalSelect[oid:int[INT], cid:int[INT], order_date:date[DATE], iid:int[INT], oid:int[INT], sku:varchar(32)[VARCHAR], quan:int[INT]]
2 Project_Default(orders.oid, orders.cid, orders.order_date, items.iid, items.oid, items.sku, items.quan)2 Project_Default(orders.oid, orders.cid, orders.order_date, items.iid, items.oid, items.sku, items.quan)
3 Flatten_HKeyOrdered(orders INNER items)3 Flatten_HKeyOrdered(orders INNER items)
4 AncestorLookup_Default(Index(items.PRIMARY) -> orders, items)4 GroupLookup_Default(Index(items.PRIMARY) -> orders, items)
5 Intersect_Ordered(skip 1 left, skip 1 right, compare 2)5 Intersect_Ordered(skip 1 left, skip 1 right, compare 2)
6 Union_Ordered(all, skip 1, compare 2)6 Union_Ordered(all, skip 1, compare 2)
7 Union_Ordered(all, skip 1, compare 2)7 Union_Ordered(all, skip 1, compare 2)
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-2.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-2.expected 2012-08-26 04:29:21 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-2.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(items.sku) -> customers, orders, items)5 GroupLookup_Default(Index(items.sku) -> customers, orders, items)
6 IndexScan_Default(Index(items.sku), sku < '8888')6 IndexScan_Default(Index(items.sku), sku < '8888')
7\ No newline at end of file7\ No newline at end of file
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-3.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-3.expected 2012-08-26 04:29:21 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-3.expected 2013-07-24 22:52:24 +0000
@@ -3,5 +3,5 @@
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 Select_HKeyOrdered(items.quan == 100)5 Select_HKeyOrdered(items.quan == 100)
6 AncestorLookup_Default(Index(items.sku) -> customers, orders, items)6 GroupLookup_Default(Index(items.sku) -> customers, orders, items)
7 IndexScan_Default(Index(items.sku), sku < '8888')7 IndexScan_Default(Index(items.sku), sku < '8888')
8\ No newline at end of file8\ No newline at end of file
99
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-4.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-4.expected 2012-08-26 04:29:21 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-4.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(items.sku) -> customers, orders, items)5 GroupLookup_Default(Index(items.sku) -> customers, orders, items)
6 IndexScan_Default(Index(items.sku), sku < '8888')6 IndexScan_Default(Index(items.sku), sku < '8888')
7\ No newline at end of file7\ No newline at end of file
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-5.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-5.expected 2012-08-26 04:29:21 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-5.expected 2013-07-24 22:52:24 +0000
@@ -1,5 +1,5 @@
1PhysicalSelect[name:varchar(32)[VARCHAR], order_date:date[DATE]]1PhysicalSelect[name:varchar(32)[VARCHAR], order_date:date[DATE]]
2 Project_Default(customers.name, orders.order_date)2 Project_Default(customers.name, orders.order_date)
3 Flatten_HKeyOrdered(customers INNER orders)3 Flatten_HKeyOrdered(customers INNER orders)
4 AncestorLookup_Default(Index(orders.order_date) -> customers, orders)4 GroupLookup_Default(Index(orders.order_date) -> customers, orders)
5 IndexScan_Default(Index(orders.order_date), order_date DESC)5 IndexScan_Default(Index(orders.order_date), order_date DESC)
6\ No newline at end of file6\ No newline at end of file
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-6.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-6.expected 2012-08-26 04:29:21 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-6.expected 2013-07-24 22:52:24 +0000
@@ -3,7 +3,7 @@
3 Filter_Default(customers - orders - items)3 Filter_Default(customers - orders - items)
4 Flatten_HKeyOrdered(customers - orders INNER items)4 Flatten_HKeyOrdered(customers - orders INNER items)
5 Flatten_HKeyOrdered(customers INNER orders)5 Flatten_HKeyOrdered(customers INNER orders)
6 AncestorLookup_Default(orders -> customers)6 GroupLookup_Default(orders -> customers)
7 Select_HKeyOrdered(items.quan > 100)7 Select_HKeyOrdered(items.quan > 100)
8 BranchLookup_Default(Index(orders.order_date) -> orders)8 GroupLookup_Default(Index(orders.order_date) -> orders, items)
9 IndexScan_Default(Index(orders.order_date), order_date DESC)9 IndexScan_Default(Index(orders.order_date), order_date DESC)
10\ No newline at end of file10\ No newline at end of file
1111
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-9.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-9.expected 2012-08-26 04:29:21 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/select-9.expected 2013-07-24 22:52:24 +0000
@@ -2,6 +2,5 @@
2 Project_Default(customers.name)2 Project_Default(customers.name)
3 Filter_Default(customers - items)3 Filter_Default(customers - items)
4 Flatten_HKeyOrdered(customers INNER items)4 Flatten_HKeyOrdered(customers INNER items)
5 AncestorLookup_Default(orders -> customers)
6 BranchLookup_Default(Index(orders.order_date) -> orders)
7 IndexScan_Default(Index(orders.order_date), order_date = DATE '2011-03-01')
8\ No newline at end of file5\ No newline at end of file
6 GroupLookup_Default(Index(orders.order_date) -> customers, items)
7 IndexScan_Default(Index(orders.order_date), order_date = DATE '2011-03-01')
9\ No newline at end of file8\ No newline at end of file
109
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-1.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-1.expected 2012-09-26 01:25:08 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-1.expected 2013-07-24 22:52:24 +0000
@@ -1,4 +1,4 @@
1PhysicalUpdate/STEP_ISOLATE1PhysicalUpdate/STEP_ISOLATE
2 Update_Returning(customers SET name = 'Smyth')2 Update_Returning(customers SET name = 'Smyth')
3 AncestorLookup_Default(Index(customers.name) -> customers)3 GroupLookup_Default(Index(customers.name) -> customers)
4 IndexScan_Default(Index(customers.name), name = 'Smith')4 IndexScan_Default(Index(customers.name), name = 'Smith')
5\ No newline at end of file5\ No newline at end of file
66
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-3.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-3.expected 2012-09-26 01:25:08 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-3.expected 2013-07-24 22:52:24 +0000
@@ -1,5 +1,5 @@
1PhysicalUpdate1PhysicalUpdate
2 Update_Returning(items SET quan = 66)2 Update_Returning(items SET quan = 66)
3 Filter_Default(items)3 Filter_Default(items)
4 BranchLookup_Default(Index(orders.order_date) -> orders)4 GroupLookup_Default(Index(orders.order_date) -> items)
5 IndexScan_Default(Index(orders.order_date), order_date > DATE '2011-04-01')5 IndexScan_Default(Index(orders.order_date), order_date > DATE '2011-04-01')
6\ No newline at end of file6\ No newline at end of file
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-4.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-4.expected 2012-09-28 04:07:13 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-4.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(items.iid, items.quan)2 Project_Default(items.iid, items.quan)
3 Update_Returning(items SET quan = items.quan + 2)3 Update_Returning(items SET quan = items.quan + 2)
4 Filter_Default(items)4 Filter_Default(items)
5 BranchLookup_Default(Index(orders.order_date) -> orders)5 GroupLookup_Default(Index(orders.order_date) -> items)
6 IndexScan_Default(Index(orders.order_date), order_date > DATE '2011-04-01')6 IndexScan_Default(Index(orders.order_date), order_date > DATE '2011-04-01')
7\ No newline at end of file7\ No newline at end of file
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-5.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-5.expected 2012-09-28 04:07:13 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-5.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(items.oid, items.iid, items.quan - 2)2 Project_Default(items.oid, items.iid, items.quan - 2)
3 Update_Returning(items SET quan = items.quan + 2)3 Update_Returning(items SET quan = items.quan + 2)
4 Filter_Default(items)4 Filter_Default(items)
5 BranchLookup_Default(Index(orders.order_date) -> orders)5 GroupLookup_Default(Index(orders.order_date) -> items)
6 IndexScan_Default(Index(orders.order_date), order_date > DATE '2011-04-01')6 IndexScan_Default(Index(orders.order_date), order_date > DATE '2011-04-01')
7\ No newline at end of file7\ No newline at end of file
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-6.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-6.expected 2012-11-28 20:08:33 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-6.expected 2013-07-24 22:52:24 +0000
@@ -8,5 +8,5 @@
8 Filter_Default(orders - items)8 Filter_Default(orders - items)
9 Flatten_HKeyOrdered(orders INNER items)9 Flatten_HKeyOrdered(orders INNER items)
10 Select_HKeyOrdered(orders.order_date > DATE '2011-03-02')10 Select_HKeyOrdered(orders.order_date > DATE '2011-03-02')
11 BranchLookup_Default(Index(orders.PRIMARY) -> orders)11 GroupLookup_Default(Index(orders.PRIMARY) -> orders, items)
12 IndexScan_Default(Index(orders.PRIMARY), oid = items.oid)12 IndexScan_Default(Index(orders.PRIMARY), oid = items.oid)
13\ No newline at end of file13\ No newline at end of file
1414
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-7.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-7.expected 2013-07-19 18:51:59 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coi-index/update-7.expected 2013-07-24 22:52:24 +0000
@@ -1,9 +1,9 @@
1PhysicalUpdate/STEP_ISOLATE1PhysicalUpdate/STEP_ISOLATE
2 Update_Returning(items SET quan = items.quan * 2)2 Update_Returning(items SET quan = items.quan * 2)
3 Map_NestedLoops()3 Map_NestedLoops()
4 AncestorLookup_Default(Index(items.PRIMARY) -> items)4 GroupLookup_Default(Index(items.PRIMARY) -> items)
5 IndexScan_Default(Index(items.PRIMARY), iid = 3)5 IndexScan_Default(Index(items.PRIMARY), iid = 3)
6 EmitBoundRow_Nested(items -> items)6 EmitBoundRow_Nested(items -> items)
7 AncestorLookup_Default(Index(items.PRIMARY) -> items)7 GroupLookup_Default(Index(items.PRIMARY) -> items)
8 Select_HKeyOrdered(items.iid == i2.iid)8 Select_HKeyOrdered(items.iid == i2.iid)
9 IndexScan_Default(Index(items.PRIMARY), iid = 3)9 IndexScan_Default(Index(items.PRIMARY), iid = 3)
10\ No newline at end of file10\ No newline at end of file
1111
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02bt.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02bt.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02bt.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)5 GroupLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)
6 IndexScan_Default(Index(customers.sku_and_date), items.sku = '1234', orders.order_date BETWEEN DATE '2011-01-01' AND DATE '2011-06-30' ASC)6 IndexScan_Default(Index(customers.sku_and_date), items.sku = '1234', orders.order_date BETWEEN DATE '2011-01-01' AND DATE '2011-06-30' ASC)
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02eq.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02eq.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02eq.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)5 GroupLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)
6 IndexScan_Default(Index(customers.sku_and_date), items.sku = '1234', orders.order_date = DATE '2011-01-01')6 IndexScan_Default(Index(customers.sku_and_date), items.sku = '1234', orders.order_date = DATE '2011-01-01')
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02ge.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02ge.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02ge.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)5 GroupLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)
6 IndexScan_Default(Index(customers.sku_and_date), items.sku = '1234', orders.order_date >= DATE '2011-01-01' ASC)6 IndexScan_Default(Index(customers.sku_and_date), items.sku = '1234', orders.order_date >= DATE '2011-01-01' ASC)
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02le.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02le.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02le.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)5 GroupLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)
6 IndexScan_Default(Index(customers.sku_and_date), items.sku = '1234', orders.order_date <= DATE '2011-01-01' ASC)6 IndexScan_Default(Index(customers.sku_and_date), items.sku = '1234', orders.order_date <= DATE '2011-01-01' ASC)
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02lt.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02lt.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02lt.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)5 GroupLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)
6 IndexScan_Default(Index(customers.sku_and_date), items.sku = '1234', orders.order_date < DATE '2011-01-01' ASC)6 IndexScan_Default(Index(customers.sku_and_date), items.sku = '1234', orders.order_date < DATE '2011-01-01' ASC)
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02r.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02r.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-02r.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)5 GroupLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)
6 IndexScan_Default(Index(customers.sku_and_date), items.sku = '1234', orders.order_date > DATE '2011-01-01' DESC)6 IndexScan_Default(Index(customers.sku_and_date), items.sku = '1234', orders.order_date > DATE '2011-01-01' DESC)
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-03l.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-03l.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-03l.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders LEFT items)3 Flatten_HKeyOrdered(customers - orders LEFT items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)5 GroupLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)
6 IndexScan_Default(Index(customers.sku_and_date), items.sku ASC, orders.order_date)6 IndexScan_Default(Index(customers.sku_and_date), items.sku ASC, orders.order_date)
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-03m.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-03m.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-03m.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)5 GroupLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)
6 IndexScan_Default(Index(customers.sku_and_date), items.sku DESC, orders.order_date ASC)6 IndexScan_Default(Index(customers.sku_and_date), items.sku DESC, orders.order_date ASC)
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-07o.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-07o.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-07o.expected 2013-07-24 22:52:24 +0000
@@ -1,4 +1,4 @@
1PhysicalSelect[order_date:date[DATE]]1PhysicalSelect[order_date:date[DATE]]
2 Project_Default(orders.order_date)2 Project_Default(orders.order_date)
3 AncestorLookup_Default(Index(customers.cname_and_sku) -> orders)3 GroupLookup_Default(Index(customers.cname_and_sku) -> orders)
4 IndexScan_Default(Index(customers.cname_and_sku), customers.name ASC, items.sku)4 IndexScan_Default(Index(customers.cname_and_sku), customers.name ASC, items.sku)
55
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-07oo.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-07oo.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-07oo.expected 2013-07-24 22:52:24 +0000
@@ -1,4 +1,4 @@
1PhysicalSelect[order_date:date[DATE]]1PhysicalSelect[order_date:date[DATE]]
2 Project_Default(orders.order_date)2 Project_Default(orders.order_date)
3 AncestorLookup_Default(Index(customers.cname_and_sku) -> orders)3 GroupLookup_Default(Index(customers.cname_and_sku) -> orders)
4 IndexScan_Default(Index(customers.cname_and_sku), customers.name ASC, items.sku)4 IndexScan_Default(Index(customers.cname_and_sku), customers.name ASC, items.sku)
55
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-07ooo.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-07ooo.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-07ooo.expected 2013-07-24 22:52:24 +0000
@@ -1,4 +1,4 @@
1PhysicalSelect[order_date:date[DATE]]1PhysicalSelect[order_date:date[DATE]]
2 Project_Default(orders.order_date)2 Project_Default(orders.order_date)
3 AncestorLookup_Default(Index(customers.cname_and_sku) -> orders)3 GroupLookup_Default(Index(customers.cname_and_sku) -> orders)
4 IndexScan_Default(Index(customers.cname_and_sku), customers.name ASC, items.sku)4 IndexScan_Default(Index(customers.cname_and_sku), customers.name ASC, items.sku)
55
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-1.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-1.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-1.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(customers.cname_and_sku) -> customers, orders, items)5 GroupLookup_Default(Index(customers.cname_and_sku) -> customers, orders, items)
6 IndexScan_Default(Index(customers.cname_and_sku), customers.name = 'Smith', items.sku = '1234')6 IndexScan_Default(Index(customers.cname_and_sku), customers.name = 'Smith', items.sku = '1234')
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-13.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-13.expected 2012-08-29 13:38:58 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-13.expected 2013-07-24 22:52:24 +0000
@@ -2,7 +2,7 @@
2 Project_Default(orders.order_date, items.sku, items.quan)2 Project_Default(orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(items.sku) -> customers, orders, items)5 GroupLookup_Default(Index(items.sku) -> customers, orders, items)
6 UnionAll_Default()6 UnionAll_Default()
7 IndexScan_Default(Index(items.sku), sku = '1234', orders.cid ASC, oid, iid)7 IndexScan_Default(Index(items.sku), sku = '1234', orders.cid ASC, oid, iid)
8 IndexScan_Default(Index(items.sku), sku = '4567', orders.cid ASC, oid, iid)8 IndexScan_Default(Index(items.sku), sku = '4567', orders.cid ASC, oid, iid)
9\ No newline at end of file9\ No newline at end of file
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-14.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-14.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-14.expected 2013-07-24 22:52:24 +0000
@@ -3,5 +3,5 @@
3 ValuesScan_Default(['1234'], ['4567'], ['6666'])3 ValuesScan_Default(['1234'], ['4567'], ['6666'])
4 Project_Default(orders.order_date, items.sku, items.quan)4 Project_Default(orders.order_date, items.sku, items.quan)
5 Flatten_HKeyOrdered(orders INNER items)5 Flatten_HKeyOrdered(orders INNER items)
6 AncestorLookup_Default(Index(customers.cname_and_sku) -> orders, items)6 GroupLookup_Default(Index(customers.cname_and_sku) -> orders, items)
7 IndexScan_Default(Index(customers.cname_and_sku), customers.name = 'Smith', items.sku = Bound(0, 0))7 IndexScan_Default(Index(customers.cname_and_sku), customers.name = 'Smith', items.sku = Bound(0, 0))
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-14p.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-14p.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-14p.expected 2013-07-24 22:52:24 +0000
@@ -4,5 +4,5 @@
4 ValuesScan_Default(['1234'], [$1], [$2], [$3])4 ValuesScan_Default(['1234'], [$1], [$2], [$3])
5 Project_Default(orders.order_date, items.sku, items.quan)5 Project_Default(orders.order_date, items.sku, items.quan)
6 Flatten_HKeyOrdered(orders INNER items)6 Flatten_HKeyOrdered(orders INNER items)
7 AncestorLookup_Default(Index(customers.cname_and_sku) -> orders, items)7 GroupLookup_Default(Index(customers.cname_and_sku) -> orders, items)
8 IndexScan_Default(Index(customers.cname_and_sku), customers.name = 'Smith', items.sku = Bound(3, 0))8 IndexScan_Default(Index(customers.cname_and_sku), customers.name = 'Smith', items.sku = Bound(3, 0))
99
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-14u.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-14u.expected 2013-01-09 21:36:37 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-14u.expected 2013-07-24 22:52:24 +0000
@@ -2,7 +2,7 @@
2 Project_Default(orders.order_date, items.sku, items.quan)2 Project_Default(orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(items.sku) -> customers, orders, items)5 GroupLookup_Default(Index(items.sku) -> customers, orders, items)
6 Intersect_Ordered(skip 1 left, skip 1 right, compare 1)6 Intersect_Ordered(skip 1 left, skip 1 right, compare 1)
7 Union_Ordered(all, skip 1, compare 3)7 Union_Ordered(all, skip 1, compare 3)
8 Union_Ordered(all, skip 1, compare 3)8 Union_Ordered(all, skip 1, compare 3)
99
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-15d.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-15d.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-15d.expected 2013-07-24 22:52:24 +0000
@@ -4,5 +4,5 @@
4 Project_Default(i2.sku)4 Project_Default(i2.sku)
5 IndexScan_Default(Index(customers.cname_and_sku), customers.name = 'Smith', items.sku)5 IndexScan_Default(Index(customers.cname_and_sku), customers.name = 'Smith', items.sku)
6 Project_Default(items.iid, items.oid, items.sku, items.quan)6 Project_Default(items.iid, items.oid, items.sku, items.quan)
7 AncestorLookup_Default(Index(items.sku) -> items)7 GroupLookup_Default(Index(items.sku) -> items)
8 IndexScan_Default(Index(items.sku), sku = Bound(0, 0), orders.cid, oid, iid)8 IndexScan_Default(Index(items.sku), sku = Bound(0, 0), orders.cid, oid, iid)
99
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-17a.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-17a.expected 2013-06-06 19:56:32 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-17a.expected 2013-07-24 22:52:24 +0000
@@ -4,6 +4,6 @@
4 Filter_Default(customers - orders - items)4 Filter_Default(customers - orders - items)
5 Flatten_HKeyOrdered(customers - orders INNER items)5 Flatten_HKeyOrdered(customers - orders INNER items)
6 Flatten_HKeyOrdered(customers INNER orders)6 Flatten_HKeyOrdered(customers INNER orders)
7 BranchLookup_Default(customers -> orders)7 GroupLookup_Default(customers -> orders, items)
8 AncestorLookup_Default(Index(addresses.state) -> customers)8 GroupLookup_Default(Index(addresses.state) -> customers)
9 IndexScan_Default(Index(addresses.state), state = 'MA')9 IndexScan_Default(Index(addresses.state), state = 'MA')
10\ No newline at end of file10\ No newline at end of file
1111
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-17b.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-17b.expected 2013-06-06 19:56:32 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-17b.expected 2013-07-24 22:52:24 +0000
@@ -6,6 +6,6 @@
6 Filter_Default(customers - orders - items)6 Filter_Default(customers - orders - items)
7 Flatten_HKeyOrdered(customers - orders INNER items)7 Flatten_HKeyOrdered(customers - orders INNER items)
8 Flatten_HKeyOrdered(customers INNER orders)8 Flatten_HKeyOrdered(customers INNER orders)
9 BranchLookup_Default(customers -> orders)9 GroupLookup_Default(customers -> orders, items)
10 AncestorLookup_Default(Index(addresses.state) -> customers)10 GroupLookup_Default(Index(addresses.state) -> customers)
11 IndexScan_Default(Index(addresses.state), state = Bound(0, 0))11 IndexScan_Default(Index(addresses.state), state = Bound(0, 0))
12\ No newline at end of file12\ No newline at end of file
1313
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-17bu.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-17bu.expected 2013-07-17 21:00:35 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-17bu.expected 2013-07-24 22:52:24 +0000
@@ -3,7 +3,7 @@
3 Sort_General(items.quan DESC)3 Sort_General(items.quan DESC)
4 Map_NestedLoops()4 Map_NestedLoops()
5 Flatten_HKeyOrdered(customers INNER addresses)5 Flatten_HKeyOrdered(customers INNER addresses)
6 AncestorLookup_Default(Index(addresses.state) -> customers, addresses)6 GroupLookup_Default(Index(addresses.state) -> customers, addresses)
7 UnionAll_Default()7 UnionAll_Default()
8 UnionAll_Default()8 UnionAll_Default()
9 IndexScan_Default(Index(addresses.state), state = 'MA', cid ASC, aid)9 IndexScan_Default(Index(addresses.state), state = 'MA', cid ASC, aid)
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-2.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-2.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-2.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)5 GroupLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)
6 IndexScan_Default(Index(customers.sku_and_date), items.sku = '1234', orders.order_date > DATE '2011-01-01' ASC)6 IndexScan_Default(Index(customers.sku_and_date), items.sku = '1234', orders.order_date > DATE '2011-01-01' ASC)
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-20.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-20.expected 2012-08-29 13:38:58 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-20.expected 2013-07-24 22:52:24 +0000
@@ -7,5 +7,5 @@
7 GroupScan_Default(customers)7 GroupScan_Default(customers)
8 Project_Default(i2.sku)8 Project_Default(i2.sku)
9 Select_HKeyOrdered(i1.quan == (i2.quan * 10))9 Select_HKeyOrdered(i1.quan == (i2.quan * 10))
10 AncestorLookup_Default(Index(items.sku) -> items)10 GroupLookup_Default(Index(items.sku) -> items)
11 IndexScan_Default(Index(items.sku), sku = customers.name)11 IndexScan_Default(Index(items.sku), sku = customers.name)
12\ No newline at end of file12\ No newline at end of file
1313
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-20.t3expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-20.t3expected 2012-10-02 13:14:54 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-20.t3expected 2013-07-24 22:52:24 +0000
@@ -7,5 +7,5 @@
7 GroupScan_Default(customers)7 GroupScan_Default(customers)
8 Project_Default(i2.sku)8 Project_Default(i2.sku)
9 Select_HKeyOrdered(i1.quan == (i2.quan * 10))9 Select_HKeyOrdered(i1.quan == (i2.quan * 10))
10 AncestorLookup_Default(Index(items.sku) -> items)10 GroupLookup_Default(Index(items.sku) -> items)
11 IndexScan_Default(Index(items.sku), sku = customers.name)11 IndexScan_Default(Index(items.sku), sku = customers.name)
12\ No newline at end of file12\ No newline at end of file
1313
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-3.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-3.expected 2012-10-19 19:07:51 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-group-index/select-3.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)2 Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)5 GroupLookup_Default(Index(customers.sku_and_date) -> customers, orders, items)
6 IndexScan_Default(Index(customers.sku_and_date), items.sku ASC, orders.order_date)6 IndexScan_Default(Index(customers.sku_and_date), items.sku ASC, orders.order_date)
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-1.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-1.expected 2013-03-06 16:01:20 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-1.expected 2013-07-24 22:52:24 +0000
@@ -1,4 +1,4 @@
1PhysicalSelect[cid:int[INT], name:varchar(32)[VARCHAR]]1PhysicalSelect[cid:int[INT], name:varchar(32)[VARCHAR]]
2 Project_Default(customers.cid, customers.name)2 Project_Default(customers.cid, customers.name)
3 AncestorLookup_Default(HKey -> customers)3 GroupLookup_Default(HKey -> customers)
4 IndexScan_FullText(test.customers.cust_ft, name:"john smith")4 IndexScan_FullText(test.customers.cust_ft, name:"john smith")
5\ No newline at end of file5\ No newline at end of file
66
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-1v.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-1v.expected 2013-03-06 16:01:20 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-1v.expected 2013-07-24 22:52:24 +0000
@@ -1,4 +1,4 @@
1PhysicalSelect[null][cid:int[INT], name:varchar(32)[VARCHAR]]1PhysicalSelect[null][cid:int[INT], name:varchar(32)[VARCHAR]]
2 Project_Default(customers.cid, customers.name)2 Project_Default(customers.cid, customers.name)
3 AncestorLookup_Default(HKey -> customers)3 GroupLookup_Default(HKey -> customers)
4 IndexScan_FullText(test.customers.cust_ft, $1)4 IndexScan_FullText(test.customers.cust_ft, $1)
5\ No newline at end of file5\ No newline at end of file
66
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-2.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-2.expected 2013-07-17 21:00:35 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-2.expected 2013-07-24 22:52:24 +0000
@@ -3,7 +3,7 @@
3 Map_NestedLoops()3 Map_NestedLoops()
4 Filter_Default(customers - addresses)4 Filter_Default(customers - addresses)
5 Flatten_HKeyOrdered(customers INNER addresses)5 Flatten_HKeyOrdered(customers INNER addresses)
6 BranchLookup_Default(HKey -> customers)6 GroupLookup_Default(HKey -> customers, addresses)
7 IndexScan_FullText(test.customers.cust_ft, +state:MA +sku:1234)7 IndexScan_FullText(test.customers.cust_ft, +state:MA +sku:1234)
8 Product_Nested(customers - addresses x customers - orders - items)8 Product_Nested(customers - addresses x customers - orders - items)
9 Filter_Default(customers - orders - items)9 Filter_Default(customers - orders - items)
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-2n.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-2n.expected 2013-07-17 21:00:35 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-2n.expected 2013-07-24 22:52:24 +0000
@@ -3,7 +3,7 @@
3 Map_NestedLoops()3 Map_NestedLoops()
4 Filter_Default(customers - addresses)4 Filter_Default(customers - addresses)
5 Flatten_HKeyOrdered(customers INNER addresses)5 Flatten_HKeyOrdered(customers INNER addresses)
6 BranchLookup_Default(HKey -> customers)6 GroupLookup_Default(HKey -> customers, addresses)
7 IndexScan_FullText(test.customers.cust_ft, -state:MA +sku:1234)7 IndexScan_FullText(test.customers.cust_ft, -state:MA +sku:1234)
8 Product_Nested(customers - addresses x customers - orders - items)8 Product_Nested(customers - addresses x customers - orders - items)
9 Filter_Default(customers - orders - items)9 Filter_Default(customers - orders - items)
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-2v.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-2v.expected 2013-07-17 21:00:35 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-2v.expected 2013-07-24 22:52:24 +0000
@@ -3,7 +3,7 @@
3 Map_NestedLoops()3 Map_NestedLoops()
4 Filter_Default(customers - addresses)4 Filter_Default(customers - addresses)
5 Flatten_HKeyOrdered(customers INNER addresses)5 Flatten_HKeyOrdered(customers INNER addresses)
6 BranchLookup_Default(HKey -> customers)6 GroupLookup_Default(HKey -> customers, addresses)
7 IndexScan_FullText(test.customers.cust_ft, TERM($1), TERM($2))7 IndexScan_FullText(test.customers.cust_ft, TERM($1), TERM($2))
8 Product_Nested(customers - addresses x customers - orders - items)8 Product_Nested(customers - addresses x customers - orders - items)
9 Filter_Default(customers - orders - items)9 Filter_Default(customers - orders - items)
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-3.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-3.expected 2013-03-06 16:01:20 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-3.expected 2013-07-24 22:52:24 +0000
@@ -1,5 +1,5 @@
1PhysicalSelect[cid:int[INT], name:varchar(32)[VARCHAR]]1PhysicalSelect[cid:int[INT], name:varchar(32)[VARCHAR]]
2 Project_Default(customers.cid, customers.name)2 Project_Default(customers.cid, customers.name)
3 Select_HKeyOrdered(in(customers.cid, 1, 2, 3))3 Select_HKeyOrdered(in(customers.cid, 1, 2, 3))
4 AncestorLookup_Default(HKey -> customers)4 GroupLookup_Default(HKey -> customers)
5 IndexScan_FullText(test.customers.cust_ft, name:john)5 IndexScan_FullText(test.customers.cust_ft, name:john)
6\ No newline at end of file6\ No newline at end of file
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-join.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-join.expected 2013-03-06 16:01:20 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia-text-index/full-text-join.expected 2013-07-24 22:52:24 +0000
@@ -1,8 +1,8 @@
1PhysicalSelect[cid:int[INT], name:varchar(32)[VARCHAR], id:int[INT], name:varchar(256)[VARCHAR], state:char(2)[VARCHAR]]1PhysicalSelect[cid:int[INT], name:varchar(32)[VARCHAR], id:int[INT], name:varchar(256)[VARCHAR], state:char(2)[VARCHAR]]
2 Map_NestedLoops()2 Map_NestedLoops()
3 AncestorLookup_Default(HKey -> customers)3 GroupLookup_Default(HKey -> customers)
4 IndexScan_FullText(test.customers.cust_ft, name:john)4 IndexScan_FullText(test.customers.cust_ft, name:john)
5 Project_Default(customers.cid, customers.name, parent.id, parent.name, parent.state)5 Project_Default(customers.cid, customers.name, parent.id, parent.name, parent.state)
6 Select_HKeyOrdered(parent.name == 'X')6 Select_HKeyOrdered(parent.name == 'X')
7 AncestorLookup_Default(Index(parent.PRIMARY) -> parent)7 GroupLookup_Default(Index(parent.PRIMARY) -> parent)
8 IndexScan_Default(Index(parent.PRIMARY), id = customers.cid)8 IndexScan_Default(Index(parent.PRIMARY), id = customers.cid)
9\ No newline at end of file9\ No newline at end of file
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia/select-1.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia/select-1.expected 2012-08-26 04:29:21 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia/select-1.expected 2013-07-24 22:52:24 +0000
@@ -2,6 +2,6 @@
2 Project_Default(customers.name, orders.order_date)2 Project_Default(customers.name, orders.order_date)
3 Filter_Default(customers - orders)3 Filter_Default(customers - orders)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 BranchLookup_Default(customers -> orders)5 GroupLookup_Default(customers -> orders)
6 AncestorLookup_Default(Index(addresses.state) -> customers)6 GroupLookup_Default(Index(addresses.state) -> customers)
7 IndexScan_Default(Index(addresses.state), state = 'MA')7 IndexScan_Default(Index(addresses.state), state = 'MA')
8\ No newline at end of file8\ No newline at end of file
99
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia/select-2.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia/select-2.expected 2013-07-17 21:00:35 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia/select-2.expected 2013-07-24 22:52:24 +0000
@@ -2,7 +2,7 @@
2 Project_Default(customers.name, orders.order_date, addresses.city)2 Project_Default(customers.name, orders.order_date, addresses.city)
3 Map_NestedLoops()3 Map_NestedLoops()
4 Flatten_HKeyOrdered(customers INNER addresses)4 Flatten_HKeyOrdered(customers INNER addresses)
5 AncestorLookup_Default(Index(addresses.state) -> customers, addresses)5 GroupLookup_Default(Index(addresses.state) -> customers, addresses)
6 IndexScan_Default(Index(addresses.state), state = 'MA')6 IndexScan_Default(Index(addresses.state), state = 'MA')
7 Product_Nested(customers - addresses x customers - orders)7 Product_Nested(customers - addresses x customers - orders)
8 Filter_Default(customers - orders)8 Filter_Default(customers - orders)
99
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia/select-3.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia/select-3.expected 2012-08-26 04:29:21 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia/select-3.expected 2013-07-24 22:52:24 +0000
@@ -2,6 +2,6 @@
2 Project_Default(customers.cid, orders.order_date)2 Project_Default(customers.cid, orders.order_date)
3 Filter_Default(customers - orders)3 Filter_Default(customers - orders)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 BranchLookup_Default(customers -> orders)5 GroupLookup_Default(customers -> orders)
6 AncestorLookup_Default(Index(addresses.state) -> customers)6 GroupLookup_Default(Index(addresses.state) -> customers)
7 IndexScan_Default(Index(addresses.state), state = 'MA')7 IndexScan_Default(Index(addresses.state), state = 'MA')
8\ No newline at end of file8\ No newline at end of file
99
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia/select-4.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia/select-4.expected 2012-08-26 04:29:21 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia/select-4.expected 2013-07-24 22:52:24 +0000
@@ -3,6 +3,6 @@
3 Filter_Default(customers - orders - items)3 Filter_Default(customers - orders - items)
4 Flatten_HKeyOrdered(customers - orders INNER items)4 Flatten_HKeyOrdered(customers - orders INNER items)
5 Flatten_HKeyOrdered(customers INNER orders)5 Flatten_HKeyOrdered(customers INNER orders)
6 BranchLookup_Default(customers -> orders)6 GroupLookup_Default(customers -> orders, items)
7 AncestorLookup_Default(Index(addresses.state) -> customers)7 GroupLookup_Default(Index(addresses.state) -> customers)
8 IndexScan_Default(Index(addresses.state), state = 'MA')8 IndexScan_Default(Index(addresses.state), state = 'MA')
9\ No newline at end of file9\ No newline at end of file
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia/select-5.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia/select-5.expected 2013-07-17 21:00:35 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia/select-5.expected 2013-07-24 22:52:24 +0000
@@ -3,7 +3,7 @@
3 Map_NestedLoops()3 Map_NestedLoops()
4 Filter_Default(customers - addresses)4 Filter_Default(customers - addresses)
5 Flatten_HKeyOrdered(customers INNER addresses)5 Flatten_HKeyOrdered(customers INNER addresses)
6 BranchLookup_Default(Index(customers.name) -> customers)6 GroupLookup_Default(Index(customers.name) -> customers, addresses)
7 IndexScan_Default(Index(customers.name), name = 'IBM')7 IndexScan_Default(Index(customers.name), name = 'IBM')
8 Product_Nested(customers - addresses x customers - orders)8 Product_Nested(customers - addresses x customers - orders)
9 Filter_Default(customers - orders)9 Filter_Default(customers - orders)
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia/select-6.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia/select-6.expected 2013-07-17 21:00:35 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia/select-6.expected 2013-07-24 22:52:24 +0000
@@ -2,7 +2,7 @@
2 Project_Default(customers.name, orders.order_date, addresses.state)2 Project_Default(customers.name, orders.order_date, addresses.state)
3 Map_NestedLoops()3 Map_NestedLoops()
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(orders.order_date) -> customers, orders)5 GroupLookup_Default(Index(orders.order_date) -> customers, orders)
6 IndexScan_Default(Index(orders.order_date), order_date > DATE '2011-01-01')6 IndexScan_Default(Index(orders.order_date), order_date > DATE '2011-01-01')
7 Product_Nested(customers - orders x customers - addresses)7 Product_Nested(customers - orders x customers - addresses)
8 Filter_Default(customers - addresses)8 Filter_Default(customers - addresses)
99
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/coia/select-7.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/coia/select-7.expected 2013-07-17 21:00:35 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/coia/select-7.expected 2013-07-24 22:52:24 +0000
@@ -4,9 +4,8 @@
4 Filter_Default(customers - orders - items)4 Filter_Default(customers - orders - items)
5 Flatten_HKeyOrdered(customers - orders INNER items)5 Flatten_HKeyOrdered(customers - orders INNER items)
6 Flatten_HKeyOrdered(customers INNER orders)6 Flatten_HKeyOrdered(customers INNER orders)
7 AncestorLookup_Default(orders -> customers)7 GroupLookup_Default(Index(orders.order_date) -> customers, orders, items)
8 BranchLookup_Default(Index(orders.order_date) -> orders)8 IndexScan_Default(Index(orders.order_date), order_date > DATE '2011-01-01')
9 IndexScan_Default(Index(orders.order_date), order_date > DATE '2011-01-01')
10 Product_Nested(customers - orders - items x customers - addresses)9 Product_Nested(customers - orders - items x customers - addresses)
11 Filter_Default(customers - addresses)10 Filter_Default(customers - addresses)
12 Flatten_HKeyOrdered(customers INNER addresses)11 Flatten_HKeyOrdered(customers INNER addresses)
1312
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/histograms/select-1.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/histograms/select-1.expected 2013-06-06 19:56:32 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/histograms/select-1.expected 2013-07-24 22:52:24 +0000
@@ -1,5 +1,5 @@
1PhysicalSelect[id:int[INT], x:int[INT], y:int[INT], z:int[INT]]1PhysicalSelect[id:int[INT], x:int[INT], y:int[INT], z:int[INT]]
2 Project_Default(t.id, t.x, t.y, t.z)2 Project_Default(t.id, t.x, t.y, t.z)
3 Sort_General(t.z ASC)3 Sort_General(t.z ASC)
4 AncestorLookup_Default(Index(t.idx_txy) -> t)4 GroupLookup_Default(Index(t.idx_txy) -> t)
5 IndexScan_Default(Index(t.idx_txy), x = 0, y = 0, id)5 IndexScan_Default(Index(t.idx_txy), x = 0, y = 0, id)
66
=== modified file 'src/test/resources/com/akiban/sql/optimizer/operator/histograms/select-2.expected'
--- src/test/resources/com/akiban/sql/optimizer/operator/histograms/select-2.expected 2013-01-02 14:53:59 +0000
+++ src/test/resources/com/akiban/sql/optimizer/operator/histograms/select-2.expected 2013-07-24 22:52:24 +0000
@@ -1,5 +1,5 @@
1PhysicalSelect[id:int[INT], x:int[INT], y:int[INT], z:int[INT]]1PhysicalSelect[id:int[INT], x:int[INT], y:int[INT], z:int[INT]]
2 Project_Default(t.id, t.x, t.y, t.z)2 Project_Default(t.id, t.x, t.y, t.z)
3 Select_HKeyOrdered((t.x == 0) AND (t.y == 1))3 Select_HKeyOrdered((t.x == 0) AND (t.y == 1))
4 AncestorLookup_Default(Index(t.idx_tz) -> t)4 GroupLookup_Default(Index(t.idx_tz) -> t)
5 IndexScan_Default(Index(t.idx_tz), z ASC, id)5 IndexScan_Default(Index(t.idx_tz), z ASC, id)
66
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02n.expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02n.expected 2013-06-06 19:56:32 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02n.expected 2013-07-24 22:52:24 +0000
@@ -5,5 +5,5 @@
5 Project_Default(Field(1), 1)5 Project_Default(Field(1), 1)
6 Filter_Default(test.customers - test.orders)6 Filter_Default(test.customers - test.orders)
7 Flatten_HKeyOrdered(test.customers INNER test.orders)7 Flatten_HKeyOrdered(test.customers INNER test.orders)
8 BranchLookup_Default(Index(test.customers.name) -> test.customers)8 GroupLookup_Default(Index(test.customers.name) -> test.customers, test.orders)
9 IndexScan_Default(Index(test.customers.name), name ASC, cid)9 IndexScan_Default(Index(test.customers.name), name ASC, cid)
10\ No newline at end of file10\ No newline at end of file
1111
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02n.t3expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02n.t3expected 2013-06-06 19:56:32 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02n.t3expected 2013-07-24 22:52:24 +0000
@@ -5,5 +5,5 @@
5 Project_Default(Field(1), 1)5 Project_Default(Field(1), 1)
6 Filter_Default(test.customers - test.orders)6 Filter_Default(test.customers - test.orders)
7 Flatten_HKeyOrdered(test.customers INNER test.orders)7 Flatten_HKeyOrdered(test.customers INNER test.orders)
8 BranchLookup_Default(Index(test.customers.name) -> test.customers)8 GroupLookup_Default(Index(test.customers.name) -> test.customers, test.orders)
9 IndexScan_Default(Index(test.customers.name), name ASC, cid)9 IndexScan_Default(Index(test.customers.name), name ASC, cid)
10\ No newline at end of file10\ No newline at end of file
1111
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02s.expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02s.expected 2012-08-29 13:38:58 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02s.expected 2013-07-24 22:52:24 +0000
@@ -4,5 +4,5 @@
4 Project_Default(Field(1), 1)4 Project_Default(Field(1), 1)
5 Filter_Default(test.customers - test.orders)5 Filter_Default(test.customers - test.orders)
6 Flatten_HKeyOrdered(test.customers INNER test.orders)6 Flatten_HKeyOrdered(test.customers INNER test.orders)
7 BranchLookup_Default(Index(test.customers.name) -> test.customers)7 GroupLookup_Default(Index(test.customers.name) -> test.customers, test.orders)
8 IndexScan_Default(Index(test.customers.name), name ASC, cid)8 IndexScan_Default(Index(test.customers.name), name ASC, cid)
9\ No newline at end of file9\ No newline at end of file
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02s.t3expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02s.t3expected 2012-10-13 01:58:10 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-02s.t3expected 2013-07-24 22:52:24 +0000
@@ -4,5 +4,5 @@
4 Project_Default(Field(1), 1)4 Project_Default(Field(1), 1)
5 Filter_Default(test.customers - test.orders)5 Filter_Default(test.customers - test.orders)
6 Flatten_HKeyOrdered(test.customers INNER test.orders)6 Flatten_HKeyOrdered(test.customers INNER test.orders)
7 BranchLookup_Default(Index(test.customers.name) -> test.customers)7 GroupLookup_Default(Index(test.customers.name) -> test.customers, test.orders)
8 IndexScan_Default(Index(test.customers.name), name ASC, cid)8 IndexScan_Default(Index(test.customers.name), name ASC, cid)
9\ No newline at end of file9\ No newline at end of file
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-1.expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-1.expected 2012-08-26 04:58:42 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-1.expected 2013-07-24 22:52:24 +0000
@@ -4,5 +4,5 @@
4 Project_Default(Field(1), Field(4), Field(4))4 Project_Default(Field(1), Field(4), Field(4))
5 Filter_Default(test.customers - test.orders)5 Filter_Default(test.customers - test.orders)
6 Flatten_HKeyOrdered(test.customers INNER test.orders)6 Flatten_HKeyOrdered(test.customers INNER test.orders)
7 BranchLookup_Default(Index(test.customers.name) -> test.customers)7 GroupLookup_Default(Index(test.customers.name) -> test.customers, test.orders)
8 IndexScan_Default(Index(test.customers.name), name ASC, cid)8 IndexScan_Default(Index(test.customers.name), name ASC, cid)
9\ No newline at end of file9\ No newline at end of file
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-2.expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-2.expected 2012-08-26 04:58:42 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-2.expected 2013-07-24 22:52:24 +0000
@@ -4,5 +4,5 @@
4 Project_Default(Field(1), 1)4 Project_Default(Field(1), 1)
5 Filter_Default(test.customers - test.orders)5 Filter_Default(test.customers - test.orders)
6 Flatten_HKeyOrdered(test.customers INNER test.orders)6 Flatten_HKeyOrdered(test.customers INNER test.orders)
7 BranchLookup_Default(Index(test.customers.name) -> test.customers)7 GroupLookup_Default(Index(test.customers.name) -> test.customers, test.orders)
8 IndexScan_Default(Index(test.customers.name), name ASC, cid)8 IndexScan_Default(Index(test.customers.name), name ASC, cid)
9\ No newline at end of file9\ No newline at end of file
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-2.t3expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-2.t3expected 2012-10-13 01:58:10 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/aggregate-2.t3expected 2013-07-24 22:52:24 +0000
@@ -4,5 +4,5 @@
4 Project_Default(Field(1), 1)4 Project_Default(Field(1), 1)
5 Filter_Default(test.customers - test.orders)5 Filter_Default(test.customers - test.orders)
6 Flatten_HKeyOrdered(test.customers INNER test.orders)6 Flatten_HKeyOrdered(test.customers INNER test.orders)
7 BranchLookup_Default(Index(test.customers.name) -> test.customers)7 GroupLookup_Default(Index(test.customers.name) -> test.customers, test.orders)
8 IndexScan_Default(Index(test.customers.name), name ASC, cid)8 IndexScan_Default(Index(test.customers.name), name ASC, cid)
9\ No newline at end of file9\ No newline at end of file
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/full-text-1.expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/full-text-1.expected 2013-03-06 16:01:20 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/full-text-1.expected 2013-07-24 22:52:24 +0000
@@ -1,4 +1,4 @@
1PhysicalSelect@46866232[cid, name]1PhysicalSelect@46866232[cid, name]
2 Project_Default(Field(0), Field(1))2 Project_Default(Field(0), Field(1))
3 AncestorLookup_Default(HKey -> test.customers)3 GroupLookup_Default(HKey -> test.customers)
4 IndexScan_FullText(test.customers.cust_ft, name:john)4 IndexScan_FullText(test.customers.cust_ft, name:john)
5\ No newline at end of file5\ No newline at end of file
66
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/full-text-2.expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/full-text-2.expected 2013-07-17 21:00:35 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/full-text-2.expected 2013-07-24 22:52:24 +0000
@@ -3,7 +3,7 @@
3 Map_NestedLoops()3 Map_NestedLoops()
4 Filter_Default(test.customers - test.addresses)4 Filter_Default(test.customers - test.addresses)
5 Flatten_HKeyOrdered(test.customers INNER test.addresses)5 Flatten_HKeyOrdered(test.customers INNER test.addresses)
6 BranchLookup_Default(HKey -> test.customers)6 GroupLookup_Default(HKey -> test.customers, test.addresses)
7 IndexScan_FullText(test.customers.cust_ft, +state:MA +sku:1234)7 IndexScan_FullText(test.customers.cust_ft, +state:MA +sku:1234)
8 Product_Nested(test.customers - test.addresses x test.customers - test.orders - test.items)8 Product_Nested(test.customers - test.addresses x test.customers - test.orders - test.items)
9 Filter_Default(test.customers - test.orders - test.items)9 Filter_Default(test.customers - test.orders - test.items)
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-1.expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-1.expected 2012-08-29 13:38:58 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-1.expected 2013-07-24 22:52:24 +0000
@@ -4,5 +4,5 @@
4 Project_Default(DISTANCE_LAT_LON(Field(0), Field(1), 42.3583, -71.0603))4 Project_Default(DISTANCE_LAT_LON(Field(0), Field(1), 42.3583, -71.0603))
5 Limit_Default(10)5 Limit_Default(10)
6 Project_Default(Field(3), Field(4))6 Project_Default(Field(3), Field(4))
7 AncestorLookup_Default(Index(test.places.places_geo) -> test.places)7 GroupLookup_Default(Index(test.places.places_geo) -> test.places)
8 IndexScan_Default(Index(test.places.places_geo), (lat, lon) ZNEAR(42.3583, -71.0603))8 IndexScan_Default(Index(test.places.places_geo), (lat, lon) ZNEAR(42.3583, -71.0603))
9\ No newline at end of file9\ No newline at end of file
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-2.expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-2.expected 2013-06-06 19:56:32 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-2.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(Field(2), Field(1))2 Project_Default(Field(2), Field(1))
3 Sort_General(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) ASC)3 Sort_General(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) ASC)
4 Select_HKeyOrdered(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) <= 0.0466)4 Select_HKeyOrdered(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) <= 0.0466)
5 AncestorLookup_Default(Index(test.places.places_geo) -> test.places)5 GroupLookup_Default(Index(test.places.places_geo) -> test.places)
6 IndexScan_Default(Index(test.places.places_geo), (lat, lon) BETWEEN (42.3583 - 0.0466, -71.0603 - 0.0466) AND (42.3583 + 0.0466, -71.0603 + 0.0466))6 IndexScan_Default(Index(test.places.places_geo), (lat, lon) BETWEEN (42.3583 - 0.0466, -71.0603 - 0.0466) AND (42.3583 + 0.0466, -71.0603 + 0.0466))
7\ No newline at end of file7\ No newline at end of file
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-2.t3expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-2.t3expected 2013-06-06 19:56:32 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-2.t3expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(Field(2), Field(1))2 Project_Default(Field(2), Field(1))
3 Sort_General(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) ASC)3 Sort_General(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) ASC)
4 Select_HKeyOrdered(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) <= 4.660000e-02)4 Select_HKeyOrdered(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) <= 4.660000e-02)
5 AncestorLookup_Default(Index(test.places.places_geo) -> test.places)5 GroupLookup_Default(Index(test.places.places_geo) -> test.places)
6 IndexScan_Default(Index(test.places.places_geo), (lat, lon) BETWEEN (42.3117, -71.1069) AND (42.4049, -71.0137))6 IndexScan_Default(Index(test.places.places_geo), (lat, lon) BETWEEN (42.3117, -71.1069) AND (42.4049, -71.0137))
7\ No newline at end of file7\ No newline at end of file
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-5.expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-5.expected 2013-06-06 19:56:32 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-5.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(Field(2), Field(1))2 Project_Default(Field(2), Field(1))
3 Sort_General(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) ASC)3 Sort_General(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) ASC)
4 Select_HKeyOrdered(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) <= 3.600000e+02)4 Select_HKeyOrdered(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) <= 3.600000e+02)
5 AncestorLookup_Default(Index(test.places.places_geo) -> test.places)5 GroupLookup_Default(Index(test.places.places_geo) -> test.places)
6 IndexScan_Default(Index(test.places.places_geo), (lat, lon) BETWEEN (-317.6417, -431.0603) AND (402.3583, 288.9397))6 IndexScan_Default(Index(test.places.places_geo), (lat, lon) BETWEEN (-317.6417, -431.0603) AND (402.3583, 288.9397))
7\ No newline at end of file7\ No newline at end of file
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-5.t3expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-5.t3expected 2013-06-06 19:56:32 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/geospatial-5.t3expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(Field(2), Field(1))2 Project_Default(Field(2), Field(1))
3 Sort_General(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) ASC)3 Sort_General(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) ASC)
4 Select_HKeyOrdered(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) <= 3.600000e+02)4 Select_HKeyOrdered(DISTANCE_LAT_LON(Field(3), Field(4), 42.3583, -71.0603) <= 3.600000e+02)
5 AncestorLookup_Default(Index(test.places.places_geo) -> test.places)5 GroupLookup_Default(Index(test.places.places_geo) -> test.places)
6 IndexScan_Default(Index(test.places.places_geo), (lat, lon) BETWEEN (-317.6417, -431.0603) AND (402.3583, 288.9397))6 IndexScan_Default(Index(test.places.places_geo), (lat, lon) BETWEEN (-317.6417, -431.0603) AND (402.3583, 288.9397))
7\ No newline at end of file7\ No newline at end of file
88
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10.expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10.expected 2012-08-28 17:43:48 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10.expected 2013-07-24 22:52:24 +0000
@@ -1,10 +1,10 @@
1PhysicalSelect@1f9f0f2[name, order_date, name]1PhysicalSelect@1f9f0f2[name, order_date, name]
2 Map_NestedLoops()2 Map_NestedLoops()
3 Flatten_HKeyOrdered(test.customers INNER test.orders)3 Flatten_HKeyOrdered(test.customers INNER test.orders)
4 AncestorLookup_Default(Index(test.orders.order_date) -> test.customers, test.orders)4 GroupLookup_Default(Index(test.orders.order_date) -> test.customers, test.orders)
5 IndexScan_Default(Index(test.orders.order_date), order_date > CAST('2011-01-01' AS DATE) ASC, cid, oid)5 IndexScan_Default(Index(test.orders.order_date), order_date > CAST('2011-01-01' AS DATE) ASC, cid, oid)
6 Project_Default(Bound(0, 1), Bound(0, 4), Field(2))6 Project_Default(Bound(0, 1), Bound(0, 4), Field(2))
7 Select_HKeyOrdered(Field(2) != 'Smith')7 Select_HKeyOrdered(Field(2) != 'Smith')
8 Filter_Default(test.child)8 Filter_Default(test.child)
9 BranchLookup_Default(Index(test.parent.name) -> test.parent)9 GroupLookup_Default(Index(test.parent.name) -> test.child)
10 IndexScan_Default(Index(test.parent.name), name = Bound(0, 1), id ASC)10 IndexScan_Default(Index(test.parent.name), name = Bound(0, 1), id ASC)
11\ No newline at end of file11\ No newline at end of file
1212
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10.t3expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10.t3expected 2012-10-13 01:58:10 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10.t3expected 2013-07-24 22:52:24 +0000
@@ -1,10 +1,10 @@
1PhysicalSelect@53ecb4e2[name, order_date, name]1PhysicalSelect@53ecb4e2[name, order_date, name]
2 Map_NestedLoops()2 Map_NestedLoops()
3 Flatten_HKeyOrdered(test.customers INNER test.orders)3 Flatten_HKeyOrdered(test.customers INNER test.orders)
4 AncestorLookup_Default(Index(test.orders.order_date) -> test.customers, test.orders)4 GroupLookup_Default(Index(test.orders.order_date) -> test.customers, test.orders)
5 IndexScan_Default(Index(test.orders.order_date), order_date > DATE '2011-01-01' ASC, cid, oid)5 IndexScan_Default(Index(test.orders.order_date), order_date > DATE '2011-01-01' ASC, cid, oid)
6 Project_Default(Bound(0, 1), Bound(0, 4), Field(2))6 Project_Default(Bound(0, 1), Bound(0, 4), Field(2))
7 Select_HKeyOrdered(Field(2) != 'Smith')7 Select_HKeyOrdered(Field(2) != 'Smith')
8 Filter_Default(test.child)8 Filter_Default(test.child)
9 BranchLookup_Default(Index(test.parent.name) -> test.parent)9 GroupLookup_Default(Index(test.parent.name) -> test.child)
10 IndexScan_Default(Index(test.parent.name), name = Bound(0, 1), id ASC)10 IndexScan_Default(Index(test.parent.name), name = Bound(0, 1), id ASC)
11\ No newline at end of file11\ No newline at end of file
1212
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10n.expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10n.expected 2012-08-28 17:43:48 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10n.expected 2013-07-24 22:52:24 +0000
@@ -9,5 +9,5 @@
9 Select_HKeyOrdered(Field(4) > CAST('2011-01-01' AS DATE))9 Select_HKeyOrdered(Field(4) > CAST('2011-01-01' AS DATE))
10 Filter_Default(test.customers - test.orders)10 Filter_Default(test.customers - test.orders)
11 Flatten_HKeyOrdered(test.customers INNER test.orders)11 Flatten_HKeyOrdered(test.customers INNER test.orders)
12 BranchLookup_Default(Index(test.customers.name) -> test.customers)12 GroupLookup_Default(Index(test.customers.name) -> test.customers, test.orders)
13 IndexScan_Default(Index(test.customers.name), name = Bound(1, 0), cid ASC)13 IndexScan_Default(Index(test.customers.name), name = Bound(1, 0), cid ASC)
14\ No newline at end of file14\ No newline at end of file
1515
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10n.t3expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10n.t3expected 2012-10-13 01:58:10 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/select-10n.t3expected 2013-07-24 22:52:24 +0000
@@ -9,5 +9,5 @@
9 Select_HKeyOrdered(Field(4) > DATE '2011-01-01')9 Select_HKeyOrdered(Field(4) > DATE '2011-01-01')
10 Filter_Default(test.customers - test.orders)10 Filter_Default(test.customers - test.orders)
11 Flatten_HKeyOrdered(test.customers INNER test.orders)11 Flatten_HKeyOrdered(test.customers INNER test.orders)
12 BranchLookup_Default(Index(test.customers.name) -> test.customers)12 GroupLookup_Default(Index(test.customers.name) -> test.customers, test.orders)
13 IndexScan_Default(Index(test.customers.name), name = Bound(1, 0), cid ASC)13 IndexScan_Default(Index(test.customers.name), name = Bound(1, 0), cid ASC)
14\ No newline at end of file14\ No newline at end of file
1515
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/select-2.expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/select-2.expected 2012-10-19 18:23:34 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/select-2.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2 Project_Default(Field(0), Field(1), Field(2), Field(3), Field(4), Field(5), Field(6), Field(7), Field(8), Field(9))2 Project_Default(Field(0), Field(1), Field(2), Field(3), Field(4), Field(5), Field(6), Field(7), Field(8), Field(9))
3 Flatten_HKeyOrdered(test.customers - test.orders INNER test.items)3 Flatten_HKeyOrdered(test.customers - test.orders INNER test.items)
4 Flatten_HKeyOrdered(test.customers INNER test.orders)4 Flatten_HKeyOrdered(test.customers INNER test.orders)
5 AncestorLookup_Default(Index(test.customers.cname_and_sku) -> test.customers, test.orders, test.items)5 GroupLookup_Default(Index(test.customers.cname_and_sku) -> test.customers, test.orders, test.items)
6 IndexScan_Default(Index(test.customers.cname_and_sku), customers.name = 'Smith', items.sku = '1234', customers.cid ASC, orders.oid, items.iid)6 IndexScan_Default(Index(test.customers.cname_and_sku), customers.name = 'Smith', items.sku = '1234', customers.cid ASC, orders.oid, items.iid)
77
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/select-3.expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/select-3.expected 2012-08-26 04:55:19 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/select-3.expected 2013-07-24 22:52:24 +0000
@@ -2,6 +2,6 @@
2 Project_Default(Field(1), Field(4))2 Project_Default(Field(1), Field(4))
3 Filter_Default(test.customers - test.orders)3 Filter_Default(test.customers - test.orders)
4 Flatten_HKeyOrdered(test.customers LEFT test.orders)4 Flatten_HKeyOrdered(test.customers LEFT test.orders)
5 BranchLookup_Default(test.customers -> test.orders)5 GroupLookup_Default(test.customers -> test.orders)
6 AncestorLookup_Default(Index(test.addresses.state) -> test.customers)6 GroupLookup_Default(Index(test.addresses.state) -> test.customers)
7 IndexScan_Default(Index(test.addresses.state), state = 'MA', cid ASC, aid)7 IndexScan_Default(Index(test.addresses.state), state = 'MA', cid ASC, aid)
8\ No newline at end of file8\ No newline at end of file
99
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/select-5.expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/select-5.expected 2013-07-17 21:00:35 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/select-5.expected 2013-07-24 22:52:24 +0000
@@ -3,7 +3,7 @@
3 Map_NestedLoops()3 Map_NestedLoops()
4 Filter_Default(test.customers - test.addresses)4 Filter_Default(test.customers - test.addresses)
5 Flatten_HKeyOrdered(test.customers INNER test.addresses)5 Flatten_HKeyOrdered(test.customers INNER test.addresses)
6 BranchLookup_Default(Index(test.customers.name) -> test.customers)6 GroupLookup_Default(Index(test.customers.name) -> test.customers, test.addresses)
7 IndexScan_Default(Index(test.customers.name), name = 'IBM', cid ASC)7 IndexScan_Default(Index(test.customers.name), name = 'IBM', cid ASC)
8 Product_Nested(test.customers - test.addresses x test.customers - test.orders)8 Product_Nested(test.customers - test.addresses x test.customers - test.orders)
9 Filter_Default(test.customers - test.orders)9 Filter_Default(test.customers - test.orders)
1010
=== modified file 'src/test/resources/com/akiban/sql/optimizer/rule/operator/update-1.expected'
--- src/test/resources/com/akiban/sql/optimizer/rule/operator/update-1.expected 2012-09-26 02:13:46 +0000
+++ src/test/resources/com/akiban/sql/optimizer/rule/operator/update-1.expected 2013-07-24 22:52:24 +0000
@@ -1,4 +1,4 @@
1PhysicalUpdate@3b58f1fa1PhysicalUpdate@3b58f1fa
2 Update_Returning()2 Update_Returning()
3 AncestorLookup_Default(Index(test.items.sku) -> test.items)3 GroupLookup_Default(Index(test.items.sku) -> test.items)
4 IndexScan_Default(Index(test.items.sku), sku = 'ABCD', orders.cid ASC, oid, iid)4 IndexScan_Default(Index(test.items.sku), sku = 'ABCD', orders.cid ASC, oid, iid)
5\ No newline at end of file5\ No newline at end of file
66
=== modified file 'src/test/resources/com/akiban/sql/pg/select/explain-2.expected'
--- src/test/resources/com/akiban/sql/pg/select/explain-2.expected 2012-08-26 05:37:38 +0000
+++ src/test/resources/com/akiban/sql/pg/select/explain-2.expected 2013-07-24 22:52:24 +0000
@@ -2,5 +2,5 @@
2Project_Default(customers.name, orders.order_date, items.sku, items.quan)2Project_Default(customers.name, orders.order_date, items.sku, items.quan)
3 Flatten_HKeyOrdered(customers - orders INNER items)3 Flatten_HKeyOrdered(customers - orders INNER items)
4 Flatten_HKeyOrdered(customers INNER orders)4 Flatten_HKeyOrdered(customers INNER orders)
5 AncestorLookup_Default(Index(items.sku) -> customers, orders, items)5 GroupLookup_Default(Index(items.sku) -> customers, orders, items)
6 IndexScan_Default(Index(items.sku), sku < '8888')6 IndexScan_Default(Index(items.sku), sku < '8888')
77
=== modified file 'src/test/resources/com/akiban/sql/pg/yaml/functional/test-statement-cache.yaml'
--- src/test/resources/com/akiban/sql/pg/yaml/functional/test-statement-cache.yaml 2013-04-30 23:22:52 +0000
+++ src/test/resources/com/akiban/sql/pg/yaml/functional/test-statement-cache.yaml 2013-07-24 22:52:24 +0000
@@ -68,7 +68,7 @@
68---68---
69- Statement: EXPLAIN SELECT id FROM t WHERE s = ?69- Statement: EXPLAIN SELECT id FROM t WHERE s = ?
70- output: [['Project_Default(t.id)'],70- output: [['Project_Default(t.id)'],
71 [' AncestorLookup_Default(Index(t.t_s) -> t)'],71 [' GroupLookup_Default(Index(t.t_s) -> t)'],
72 [' IndexScan_Default(Index(t.t_s), s = $1)']]72 [' IndexScan_Default(Index(t.t_s), s = $1)']]
73---73---
74- JMX: com.akiban:type=PostgresServer74- JMX: com.akiban:type=PostgresServer
@@ -85,7 +85,7 @@
85---85---
86- Statement: EXPLAIN SELECT id FROM t WHERE s = ?86- Statement: EXPLAIN SELECT id FROM t WHERE s = ?
87- output: [['Project_Default(t.id)'],87- output: [['Project_Default(t.id)'],
88 [' AncestorLookup_Default(Index(t.t_s) -> t)'],88 [' GroupLookup_Default(Index(t.t_s) -> t)'],
89 [' IndexScan_Default(Index(t.t_s), s = $1)']]89 [' IndexScan_Default(Index(t.t_s), s = $1)']]
90---90---
91- Statement: SELECT id FROM t WHERE s = 191- Statement: SELECT id FROM t WHERE s = 1

Subscribers

People subscribed via source and target branches