Merge lp:~mmcm/akiban-server/pipeline-spatial-index-scan into lp:~akiban-technologies/akiban-server/trunk

Proposed by Mike McMahon
Status: Merged
Approved by: Thomas Jones-Low
Approved revision: 2710
Merged at revision: 2705
Proposed branch: lp:~mmcm/akiban-server/pipeline-spatial-index-scan
Merge into: lp:~akiban-technologies/akiban-server/trunk
Diff against target: 518 lines (+154/-40)
17 files modified
src/main/java/com/akiban/qp/memoryadapter/MemoryAdapter.java (+1/-1)
src/main/java/com/akiban/qp/operator/API.java (+14/-0)
src/main/java/com/akiban/qp/operator/IndexScan_Default.java (+2/-2)
src/main/java/com/akiban/qp/operator/StoreAdapter.java (+2/-1)
src/main/java/com/akiban/qp/persistitadapter/PersistitAdapter.java (+3/-2)
src/main/java/com/akiban/qp/persistitadapter/PersistitIndexCursor.java (+3/-2)
src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursor.java (+3/-2)
src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursorSpatial_InBox.java (+5/-4)
src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursorSpatial_NearPoint.java (+4/-8)
src/main/java/com/akiban/qp/persistitadapter/indexcursor/PersistitSorter.java (+1/-1)
src/main/java/com/akiban/qp/util/MultiCursor.java (+18/-4)
src/test/java/com/akiban/qp/operator/OperatorTestHelper.java (+2/-1)
src/test/java/com/akiban/server/test/it/qp/MultiCursorIT.java (+26/-2)
src/test/java/com/akiban/server/test/it/qp/SpatialLatLonGroupIndexScanIT.java (+7/-3)
src/test/java/com/akiban/server/test/it/qp/SpatialLatLonGroupIndexScanLookaheadIT.java (+26/-0)
src/test/java/com/akiban/server/test/it/qp/SpatialLatLonTableIndexScanIT.java (+11/-7)
src/test/java/com/akiban/server/test/it/qp/SpatialLatLonTableIndexScanLookaheadIT.java (+26/-0)
To merge this branch: bzr merge lp:~mmcm/akiban-server/pipeline-spatial-index-scan
Reviewer Review Type Date Requested Status
Thomas Jones-Low Approve
Review via email: mp+175656@code.launchpad.net

Description of the change

Pipelining for spatial index scans.

For near point, all subcursors are already being opened at the same time. But the code needs to be adjusted a little to not try to read from any of them then.

For box, add an option to MultiCursor to open all cursors at once. And plumb it around from the IndexScan Cursors, which decide based on whether they are in lookahead mode or not.

To post a comment you must log in.
2710. By Mike McMahon

Forgot the @Override.

Revision history for this message
Thomas Jones-Low (tjoneslo) wrote :

Looks as described.

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/memoryadapter/MemoryAdapter.java'
--- src/main/java/com/akiban/qp/memoryadapter/MemoryAdapter.java 2013-07-09 20:37:04 +0000
+++ src/main/java/com/akiban/qp/memoryadapter/MemoryAdapter.java 2013-07-18 20:08:26 +0000
@@ -75,7 +75,7 @@
75 @Override75 @Override
76 public RowCursor newIndexCursor(QueryContext context, Index index,76 public RowCursor newIndexCursor(QueryContext context, Index index,
77 IndexKeyRange keyRange, Ordering ordering,77 IndexKeyRange keyRange, Ordering ordering,
78 IndexScanSelector scanSelector, boolean usePValues) {78 IndexScanSelector scanSelector, boolean usePValues, boolean openAllSubCursors) {
79 79
80 Table table = index.rootMostTable();80 Table table = index.rootMostTable();
81 if (table.isUserTable()) {81 if (table.isUserTable()) {
8282
=== modified file 'src/main/java/com/akiban/qp/operator/API.java'
--- src/main/java/com/akiban/qp/operator/API.java 2013-07-17 20:34:35 +0000
+++ src/main/java/com/akiban/qp/operator/API.java 2013-07-18 20:08:26 +0000
@@ -419,6 +419,20 @@
419419
420 public static Operator indexScan_Default(IndexRowType indexType,420 public static Operator indexScan_Default(IndexRowType indexType,
421 IndexKeyRange indexKeyRange,421 IndexKeyRange indexKeyRange,
422 int lookaheadQuantum)
423 {
424 Ordering ordering = new Ordering();
425 int fields = indexType.nFields();
426 for (int f = 0; f < fields; f++) {
427 ordering.append(new TPreparedField(indexType.typeInstanceAt(f), f), true);
428 }
429 IndexScanSelector indexScanSelector = IndexScanSelector.leftJoinAfter(indexType.index(),
430 indexType.tableType().userTable());
431 return indexScan_Default(indexType, indexKeyRange, ordering, indexScanSelector, lookaheadQuantum);
432 }
433
434 public static Operator indexScan_Default(IndexRowType indexType,
435 IndexKeyRange indexKeyRange,
422 Ordering ordering,436 Ordering ordering,
423 IndexScanSelector indexScanSelector,437 IndexScanSelector indexScanSelector,
424 int lookaheadQuantum)438 int lookaheadQuantum)
425439
=== modified file 'src/main/java/com/akiban/qp/operator/IndexScan_Default.java'
--- src/main/java/com/akiban/qp/operator/IndexScan_Default.java 2013-07-15 21:16:57 +0000
+++ src/main/java/com/akiban/qp/operator/IndexScan_Default.java 2013-07-18 20:08:26 +0000
@@ -374,7 +374,7 @@
374 {374 {
375 super(context, bindingsCursor);375 super(context, bindingsCursor);
376 UserTable table = (UserTable)index.rootMostTable();376 UserTable table = (UserTable)index.rootMostTable();
377 this.cursor = adapter(table).newIndexCursor(context, index, indexKeyRange, ordering, scanSelector, usePValues);377 this.cursor = adapter(table).newIndexCursor(context, index, indexKeyRange, ordering, scanSelector, usePValues, false);
378 }378 }
379379
380 // Object state380 // Object state
@@ -576,7 +576,7 @@
576 UserTable table = (UserTable)index.rootMostTable();576 UserTable table = (UserTable)index.rootMostTable();
577 StoreAdapter adapter = adapter(table);577 StoreAdapter adapter = adapter(table);
578 for (int i = 0; i < quantum; i++) {578 for (int i = 0; i < quantum; i++) {
579 RowCursor cursor = adapter.newIndexCursor(context, index, indexKeyRange, ordering, scanSelector, usePValues);579 RowCursor cursor = adapter.newIndexCursor(context, index, indexKeyRange, ordering, scanSelector, usePValues, true);
580 cursorPool.add(cursor);580 cursorPool.add(cursor);
581 }581 }
582 }582 }
583583
=== modified file 'src/main/java/com/akiban/qp/operator/StoreAdapter.java'
--- src/main/java/com/akiban/qp/operator/StoreAdapter.java 2013-07-09 20:37:04 +0000
+++ src/main/java/com/akiban/qp/operator/StoreAdapter.java 2013-07-18 20:08:26 +0000
@@ -57,7 +57,8 @@
57 IndexKeyRange keyRange,57 IndexKeyRange keyRange,
58 API.Ordering ordering,58 API.Ordering ordering,
59 IndexScanSelector scanSelector,59 IndexScanSelector scanSelector,
60 boolean usePValues);60 boolean usePValues,
61 boolean openAllSubCursors);
6162
62 public abstract <HKEY extends com.akiban.qp.row.HKey> HKEY newHKey(HKey hKeyMetadata);63 public abstract <HKEY extends com.akiban.qp.row.HKey> HKEY newHKey(HKey hKeyMetadata);
6364
6465
=== modified file 'src/main/java/com/akiban/qp/persistitadapter/PersistitAdapter.java'
--- src/main/java/com/akiban/qp/persistitadapter/PersistitAdapter.java 2013-07-13 17:12:00 +0000
+++ src/main/java/com/akiban/qp/persistitadapter/PersistitAdapter.java 2013-07-18 20:08:26 +0000
@@ -72,14 +72,15 @@
7272
73 @Override73 @Override
74 public RowCursor newIndexCursor(QueryContext context, Index index, IndexKeyRange keyRange, API.Ordering ordering,74 public RowCursor newIndexCursor(QueryContext context, Index index, IndexKeyRange keyRange, API.Ordering ordering,
75 IndexScanSelector selector, boolean usePValues)75 IndexScanSelector selector, boolean usePValues, boolean openAllSubCursors)
76 {76 {
77 return new PersistitIndexCursor(context,77 return new PersistitIndexCursor(context,
78 schema.indexRowType(index),78 schema.indexRowType(index),
79 keyRange,79 keyRange,
80 ordering,80 ordering,
81 selector,81 selector,
82 usePValues);82 usePValues,
83 openAllSubCursors);
83 }84 }
8485
85 @Override86 @Override
8687
=== modified file 'src/main/java/com/akiban/qp/persistitadapter/PersistitIndexCursor.java'
--- src/main/java/com/akiban/qp/persistitadapter/PersistitIndexCursor.java 2013-07-09 17:26:33 +0000
+++ src/main/java/com/akiban/qp/persistitadapter/PersistitIndexCursor.java 2013-07-18 20:08:26 +0000
@@ -116,7 +116,8 @@
116 IndexKeyRange keyRange,116 IndexKeyRange keyRange,
117 API.Ordering ordering,117 API.Ordering ordering,
118 IndexScanSelector selector,118 IndexScanSelector selector,
119 boolean usePValues)119 boolean usePValues,
120 boolean openAllSubCursors)
120 {121 {
121 this.keyRange = keyRange;122 this.keyRange = keyRange;
122 this.ordering = ordering;123 this.ordering = ordering;
@@ -127,7 +128,7 @@
127 this.selector = selector;128 this.selector = selector;
128 this.idle = true;129 this.idle = true;
129 this.rowState = context.getStore().createIterationHelper(indexRowType);130 this.rowState = context.getStore().createIterationHelper(indexRowType);
130 this.indexCursor = IndexCursor.create(context, keyRange, ordering, rowState, usePValues);131 this.indexCursor = IndexCursor.create(context, keyRange, ordering, rowState, usePValues, openAllSubCursors);
131 }132 }
132133
133 // For use by this class134 // For use by this class
134135
=== modified file 'src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursor.java'
--- src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursor.java 2013-07-09 00:42:04 +0000
+++ src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursor.java 2013-07-18 20:08:26 +0000
@@ -128,7 +128,8 @@
128 IndexKeyRange keyRange,128 IndexKeyRange keyRange,
129 API.Ordering ordering,129 API.Ordering ordering,
130 IterationHelper iterationHelper,130 IterationHelper iterationHelper,
131 boolean usePValues)131 boolean usePValues,
132 boolean openAllSubCursors)
132 {133 {
133 SortKeyAdapter<?, ?> adapter =134 SortKeyAdapter<?, ?> adapter =
134 usePValues135 usePValues
@@ -138,7 +139,7 @@
138 keyRange != null && keyRange.spatial()139 keyRange != null && keyRange.spatial()
139 ? keyRange.hi() == null140 ? keyRange.hi() == null
140 ? IndexCursorSpatial_NearPoint.create(context, iterationHelper, keyRange)141 ? IndexCursorSpatial_NearPoint.create(context, iterationHelper, keyRange)
141 : IndexCursorSpatial_InBox.create(context, iterationHelper, keyRange)142 : IndexCursorSpatial_InBox.create(context, iterationHelper, keyRange, openAllSubCursors)
142 : ordering.allAscending() || ordering.allDescending()143 : ordering.allAscending() || ordering.allDescending()
143 ? (keyRange != null && keyRange.lexicographic()144 ? (keyRange != null && keyRange.lexicographic()
144 ? IndexCursorUnidirectionalLexicographic.create(context, iterationHelper, keyRange, ordering, adapter)145 ? IndexCursorUnidirectionalLexicographic.create(context, iterationHelper, keyRange, ordering, adapter)
145146
=== modified file 'src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursorSpatial_InBox.java'
--- src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursorSpatial_InBox.java 2013-07-09 17:26:33 +0000
+++ src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursorSpatial_InBox.java 2013-07-18 20:08:26 +0000
@@ -93,18 +93,19 @@
9393
94 public static IndexCursorSpatial_InBox create(QueryContext context,94 public static IndexCursorSpatial_InBox create(QueryContext context,
95 IterationHelper iterationHelper,95 IterationHelper iterationHelper,
96 IndexKeyRange keyRange)96 IndexKeyRange keyRange,
97 boolean openAll)
97 {98 {
98 return new IndexCursorSpatial_InBox(context, iterationHelper, keyRange);99 return new IndexCursorSpatial_InBox(context, iterationHelper, keyRange, openAll);
99 }100 }
100101
101 // For use by this class102 // For use by this class
102103
103 private IndexCursorSpatial_InBox(QueryContext context, IterationHelper iterationHelper, IndexKeyRange keyRange)104 private IndexCursorSpatial_InBox(QueryContext context, IterationHelper iterationHelper, IndexKeyRange keyRange, boolean openAll)
104 {105 {
105 super(context, iterationHelper);106 super(context, iterationHelper);
106 assert keyRange.spatial();107 assert keyRange.spatial();
107 this.multiCursor = new MultiCursor();108 this.multiCursor = new MultiCursor(openAll);
108 this.iterationHelper = iterationHelper;109 this.iterationHelper = iterationHelper;
109 Index spatialIndex = keyRange.indexRowType().index();110 Index spatialIndex = keyRange.indexRowType().index();
110 assert spatialIndex.isSpatial() : spatialIndex;111 assert spatialIndex.isSpatial() : spatialIndex;
111112
=== modified file 'src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursorSpatial_NearPoint.java'
--- src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursorSpatial_NearPoint.java 2013-07-09 17:26:33 +0000
+++ src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursorSpatial_NearPoint.java 2013-07-18 20:08:26 +0000
@@ -51,16 +51,11 @@
51 {51 {
52 super.open();52 super.open();
53 // iterationHelper.closeIteration() closes the PersistitIndexCursor, releasing its Exchange.53 // iterationHelper.closeIteration() closes the PersistitIndexCursor, releasing its Exchange.
54 // This iteration uses the Exchanges in the IndexScanRowStates owned by each cursor of the MultiCursor.
55 iterationHelper.closeIteration();54 iterationHelper.closeIteration();
56 geCursor.open();55 geCursor.open();
57 geRow = geCursor.next();56 geNeedToAdvance = true;
58 geDistance = distanceFromStart(geRow);
59 geNeedToAdvance = false;
60 ltCursor.open();57 ltCursor.open();
61 ltRow = ltCursor.next();58 ltNeedToAdvance = true;
62 ltDistance = distanceFromStart(ltRow);
63 ltNeedToAdvance = false;
64 }59 }
6560
66 @Override61 @Override
@@ -72,7 +67,8 @@
72 geRow = geCursor.next();67 geRow = geCursor.next();
73 geDistance = distanceFromStart(geRow);68 geDistance = distanceFromStart(geRow);
74 geNeedToAdvance = false;69 geNeedToAdvance = false;
75 } else if (ltNeedToAdvance) {70 }
71 if (ltNeedToAdvance) {
76 ltRow = ltCursor.next();72 ltRow = ltCursor.next();
77 ltDistance = distanceFromStart(ltRow);73 ltDistance = distanceFromStart(ltRow);
78 ltNeedToAdvance = false;74 ltNeedToAdvance = false;
7975
=== modified file 'src/main/java/com/akiban/qp/persistitadapter/indexcursor/PersistitSorter.java'
--- src/main/java/com/akiban/qp/persistitadapter/indexcursor/PersistitSorter.java 2013-07-16 18:27:15 +0000
+++ src/main/java/com/akiban/qp/persistitadapter/indexcursor/PersistitSorter.java 2013-07-18 20:08:26 +0000
@@ -147,7 +147,7 @@
147 private RowCursor cursor()147 private RowCursor cursor()
148 {148 {
149 exchange.clear();149 exchange.clear();
150 IndexCursor indexCursor = IndexCursor.create(context, null, ordering, iterationHelper, usePValues);150 IndexCursor indexCursor = IndexCursor.create(context, null, ordering, iterationHelper, usePValues, false);
151 indexCursor.rebind(bindings);151 indexCursor.rebind(bindings);
152 return indexCursor;152 return indexCursor;
153 }153 }
154154
=== modified file 'src/main/java/com/akiban/qp/util/MultiCursor.java'
--- src/main/java/com/akiban/qp/util/MultiCursor.java 2013-07-09 19:53:07 +0000
+++ src/main/java/com/akiban/qp/util/MultiCursor.java 2013-07-18 20:08:26 +0000
@@ -34,9 +34,12 @@
34 @Override34 @Override
35 public void open()35 public void open()
36 {36 {
37 sealed = false;37 sealed = true;
38 // TODO: Have a mode where all the cursors get opened so that38 if (openAll) {
39 // they can start in parallel.39 for (RowCursor cursor : cursors) {
40 cursor.open();
41 }
42 }
40 cursorIterator = cursors.iterator();43 cursorIterator = cursors.iterator();
41 startNextCursor();44 startNextCursor();
42 }45 }
@@ -109,6 +112,14 @@
109112
110 // MultiCursor interface113 // MultiCursor interface
111114
115 public MultiCursor() {
116 this(false);
117 }
118
119 public MultiCursor(boolean openAll) {
120 this.openAll = openAll;
121 }
122
112 public void addCursor(RowCursor cursor)123 public void addCursor(RowCursor cursor)
113 {124 {
114 if (sealed) {125 if (sealed) {
@@ -126,7 +137,9 @@
126 current.close();137 current.close();
127 }138 }
128 current = cursorIterator.next();139 current = cursorIterator.next();
129 current.open();140 if (!openAll) {
141 current.open();
142 }
130 } else {143 } else {
131 current = null;144 current = null;
132 }145 }
@@ -135,6 +148,7 @@
135 // Object state148 // Object state
136149
137 private final List<RowCursor> cursors = new ArrayList<>();150 private final List<RowCursor> cursors = new ArrayList<>();
151 private final boolean openAll;
138 private boolean sealed = false;152 private boolean sealed = false;
139 private Iterator<RowCursor> cursorIterator;153 private Iterator<RowCursor> cursorIterator;
140 private RowCursor current;154 private RowCursor current;
141155
=== modified file 'src/test/java/com/akiban/qp/operator/OperatorTestHelper.java'
--- src/test/java/com/akiban/qp/operator/OperatorTestHelper.java 2013-07-09 20:37:04 +0000
+++ src/test/java/com/akiban/qp/operator/OperatorTestHelper.java 2013-07-18 20:08:26 +0000
@@ -193,7 +193,8 @@
193 IndexKeyRange keyRange,193 IndexKeyRange keyRange,
194 API.Ordering ordering,194 API.Ordering ordering,
195 IndexScanSelector selector,195 IndexScanSelector selector,
196 boolean usePValues)196 boolean usePValues,
197 boolean openAllSubCursors)
197 {198 {
198 throw new UnsupportedOperationException();199 throw new UnsupportedOperationException();
199 }200 }
200201
=== modified file 'src/test/java/com/akiban/server/test/it/qp/MultiCursorIT.java'
--- src/test/java/com/akiban/server/test/it/qp/MultiCursorIT.java 2013-07-09 20:37:04 +0000
+++ src/test/java/com/akiban/server/test/it/qp/MultiCursorIT.java 2013-07-18 20:08:26 +0000
@@ -50,6 +50,14 @@
50 queryBindings = queryContext.createBindings();50 queryBindings = queryContext.createBindings();
51 }51 }
5252
53 @Test(expected=IllegalStateException.class)
54 public void testSealed()
55 {
56 MultiCursor multiCursor = multiCursor();
57 multiCursor.open();
58 multiCursor.addCursor(new TestCursor(new int[]{}));
59 }
60
53 @Test61 @Test
54 public void testNoCursors()62 public void testNoCursors()
55 {63 {
@@ -84,7 +92,18 @@
84 @Test92 @Test
85 public void testMultipleCursors()93 public void testMultipleCursors()
86 {94 {
87 RowCursor multiCursor = multiCursor(new TestCursor(new int[]{}),95 testMultipleCursors(false);
96 }
97
98 @Test
99 public void testOpenAll()
100 {
101 testMultipleCursors(true);
102 }
103
104 private void testMultipleCursors(boolean openAll) {
105 RowCursor multiCursor = multiCursor(openAll,
106 new TestCursor(new int[]{}),
88 new TestCursor(new int[]{0, 1, 2}),107 new TestCursor(new int[]{0, 1, 2}),
89 new TestCursor(new int[]{}),108 new TestCursor(new int[]{}),
90 new TestCursor(new int[]{}),109 new TestCursor(new int[]{}),
@@ -104,7 +123,12 @@
104123
105 private MultiCursor multiCursor(TestCursor ... cursors)124 private MultiCursor multiCursor(TestCursor ... cursors)
106 {125 {
107 MultiCursor multiCursor = new MultiCursor();126 return multiCursor(false, cursors);
127 }
128
129 private MultiCursor multiCursor(boolean openAll, TestCursor ... cursors)
130 {
131 MultiCursor multiCursor = new MultiCursor(openAll);
108 for (TestCursor cursor : cursors) {132 for (TestCursor cursor : cursors) {
109 multiCursor.addCursor(cursor);133 multiCursor.addCursor(cursor);
110 }134 }
111135
=== modified file 'src/test/java/com/akiban/server/test/it/qp/SpatialLatLonGroupIndexScanIT.java'
--- src/test/java/com/akiban/server/test/it/qp/SpatialLatLonGroupIndexScanIT.java 2013-07-09 21:10:22 +0000
+++ src/test/java/com/akiban/server/test/it/qp/SpatialLatLonGroupIndexScanIT.java 2013-07-18 20:08:26 +0000
@@ -93,6 +93,10 @@
93 queryBindings = queryContext.createBindings();93 queryBindings = queryContext.createBindings();
94 }94 }
9595
96 protected int lookaheadQuantum() {
97 return 1;
98 }
99
96 @Test100 @Test
97 public void testLoad()101 public void testLoad()
98 {102 {
@@ -290,7 +294,7 @@
290 IndexBound upperRight = new IndexBound(row(pSpatialIndexRowType, beforeEQ, latHi, lonHi),294 IndexBound upperRight = new IndexBound(row(pSpatialIndexRowType, beforeEQ, latHi, lonHi),
291 new SetColumnSelector(0, 1, 2));295 new SetColumnSelector(0, 1, 2));
292 IndexKeyRange box = IndexKeyRange.spatial(pSpatialIndexRowType, lowerLeft, upperRight);296 IndexKeyRange box = IndexKeyRange.spatial(pSpatialIndexRowType, lowerLeft, upperRight);
293 Operator plan = indexScan_Default(pSpatialIndexRowType, false, box);297 Operator plan = indexScan_Default(pSpatialIndexRowType, box, lookaheadQuantum());
294 Cursor cursor = API.cursor(plan, queryContext, queryBindings);298 Cursor cursor = API.cursor(plan, queryContext, queryBindings);
295 cursor.openTopLevel();299 cursor.openTopLevel();
296 Row row;300 Row row;
@@ -369,7 +373,7 @@
369 IndexBound upperRight = new IndexBound(row(cSpatialIndexRowType, beforeEQ, latHi, lonHi),373 IndexBound upperRight = new IndexBound(row(cSpatialIndexRowType, beforeEQ, latHi, lonHi),
370 new SetColumnSelector(0, 1, 2));374 new SetColumnSelector(0, 1, 2));
371 IndexKeyRange box = IndexKeyRange.spatial(cSpatialIndexRowType, lowerLeft, upperRight);375 IndexKeyRange box = IndexKeyRange.spatial(cSpatialIndexRowType, lowerLeft, upperRight);
372 Operator plan = indexScan_Default(cSpatialIndexRowType, false, box);376 Operator plan = indexScan_Default(cSpatialIndexRowType, box, lookaheadQuantum());
373 Cursor cursor = API.cursor(plan, queryContext, queryBindings);377 Cursor cursor = API.cursor(plan, queryContext, queryBindings);
374 cursor.openTopLevel();378 cursor.openTopLevel();
375 Row row;379 Row row;
@@ -424,7 +428,7 @@
424 new IndexBound(row(cSpatialIndexRowType, beforeEQ, queryLat, queryLon),428 new IndexBound(row(cSpatialIndexRowType, beforeEQ, queryLat, queryLon),
425 new SetColumnSelector(0, 1, 2));429 new SetColumnSelector(0, 1, 2));
426 IndexKeyRange zStartRange = IndexKeyRange.around(cSpatialIndexRowType, zStartBound);430 IndexKeyRange zStartRange = IndexKeyRange.around(cSpatialIndexRowType, zStartBound);
427 Operator plan = indexScan_Default(cSpatialIndexRowType, false, zStartRange);431 Operator plan = indexScan_Default(cSpatialIndexRowType, zStartRange, lookaheadQuantum());
428 Cursor cursor = API.cursor(plan, queryContext, queryBindings);432 Cursor cursor = API.cursor(plan, queryContext, queryBindings);
429 cursor.openTopLevel();433 cursor.openTopLevel();
430 Row row;434 Row row;
431435
=== added file 'src/test/java/com/akiban/server/test/it/qp/SpatialLatLonGroupIndexScanLookaheadIT.java'
--- src/test/java/com/akiban/server/test/it/qp/SpatialLatLonGroupIndexScanLookaheadIT.java 1970-01-01 00:00:00 +0000
+++ src/test/java/com/akiban/server/test/it/qp/SpatialLatLonGroupIndexScanLookaheadIT.java 2013-07-18 20:08:26 +0000
@@ -0,0 +1,26 @@
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
20public class SpatialLatLonGroupIndexScanLookaheadIT extends SpatialLatLonGroupIndexScanIT
21{
22 @Override
23 protected int lookaheadQuantum() {
24 return 10;
25 }
26}
027
=== modified file 'src/test/java/com/akiban/server/test/it/qp/SpatialLatLonTableIndexScanIT.java'
--- src/test/java/com/akiban/server/test/it/qp/SpatialLatLonTableIndexScanIT.java 2013-07-09 21:10:22 +0000
+++ src/test/java/com/akiban/server/test/it/qp/SpatialLatLonTableIndexScanIT.java 2013-07-18 20:08:26 +0000
@@ -80,6 +80,10 @@
80 queryBindings = queryContext.createBindings();80 queryBindings = queryContext.createBindings();
81 }81 }
8282
83 protected int lookaheadQuantum() {
84 return 1;
85 }
86
83 @Test87 @Test
84 public void testLoad()88 public void testLoad()
85 {89 {
@@ -341,7 +345,7 @@
341 IndexBound upperRight = new IndexBound(row(latLonIndexRowType, latHi, lonHi),345 IndexBound upperRight = new IndexBound(row(latLonIndexRowType, latHi, lonHi),
342 new SetColumnSelector(0, 1));346 new SetColumnSelector(0, 1));
343 IndexKeyRange box = IndexKeyRange.spatial(latLonIndexRowType, lowerLeft, upperRight);347 IndexKeyRange box = IndexKeyRange.spatial(latLonIndexRowType, lowerLeft, upperRight);
344 Operator plan = indexScan_Default(latLonIndexRowType, false, box);348 Operator plan = indexScan_Default(latLonIndexRowType, box, lookaheadQuantum());
345 Cursor cursor = API.cursor(plan, queryContext, queryBindings);349 Cursor cursor = API.cursor(plan, queryContext, queryBindings);
346 cursor.openTopLevel();350 cursor.openTopLevel();
347 Row row;351 Row row;
@@ -404,7 +408,7 @@
404 IndexBound upperRight = new IndexBound(row(latLonIndexRowType, latHi, lonHi),408 IndexBound upperRight = new IndexBound(row(latLonIndexRowType, latHi, lonHi),
405 new SetColumnSelector(0, 1));409 new SetColumnSelector(0, 1));
406 IndexKeyRange box = IndexKeyRange.spatial(latLonIndexRowType, lowerLeft, upperRight);410 IndexKeyRange box = IndexKeyRange.spatial(latLonIndexRowType, lowerLeft, upperRight);
407 Operator plan = indexScan_Default(latLonIndexRowType, false, box);411 Operator plan = indexScan_Default(latLonIndexRowType, box, lookaheadQuantum());
408 Cursor cursor = API.cursor(plan, queryContext, queryBindings);412 Cursor cursor = API.cursor(plan, queryContext, queryBindings);
409 cursor.openTopLevel();413 cursor.openTopLevel();
410 Row row;414 Row row;
@@ -469,7 +473,7 @@
469 IndexBound upperRight = new IndexBound(row(beforeLatLonIndexRowType, before, latHi, lonHi),473 IndexBound upperRight = new IndexBound(row(beforeLatLonIndexRowType, before, latHi, lonHi),
470 new SetColumnSelector(0, 1, 2));474 new SetColumnSelector(0, 1, 2));
471 IndexKeyRange box = IndexKeyRange.spatial(beforeLatLonIndexRowType, lowerLeft, upperRight);475 IndexKeyRange box = IndexKeyRange.spatial(beforeLatLonIndexRowType, lowerLeft, upperRight);
472 Operator plan = indexScan_Default(beforeLatLonIndexRowType, false, box);476 Operator plan = indexScan_Default(beforeLatLonIndexRowType, box, lookaheadQuantum());
473 Cursor cursor = API.cursor(plan, queryContext, queryBindings);477 Cursor cursor = API.cursor(plan, queryContext, queryBindings);
474 cursor.openTopLevel();478 cursor.openTopLevel();
475 Row row;479 Row row;
@@ -503,7 +507,7 @@
503 IndexBound zStartBound = new IndexBound(row(latLonIndexRowType, queryLat, queryLon),507 IndexBound zStartBound = new IndexBound(row(latLonIndexRowType, queryLat, queryLon),
504 new SetColumnSelector(0, 1));508 new SetColumnSelector(0, 1));
505 IndexKeyRange zStartRange = IndexKeyRange.around(latLonIndexRowType, zStartBound);509 IndexKeyRange zStartRange = IndexKeyRange.around(latLonIndexRowType, zStartBound);
506 Operator plan = indexScan_Default(latLonIndexRowType, false, zStartRange);510 Operator plan = indexScan_Default(latLonIndexRowType, zStartRange, lookaheadQuantum());
507 Cursor cursor = API.cursor(plan, queryContext, queryBindings);511 Cursor cursor = API.cursor(plan, queryContext, queryBindings);
508 cursor.openTopLevel();512 cursor.openTopLevel();
509 Row row;513 Row row;
@@ -558,7 +562,7 @@
558 new IndexBound(row(beforeLatLonIndexRowType, before, queryLat, queryLon),562 new IndexBound(row(beforeLatLonIndexRowType, before, queryLat, queryLon),
559 new SetColumnSelector(0, 1, 2));563 new SetColumnSelector(0, 1, 2));
560 IndexKeyRange zStartRange = IndexKeyRange.around(beforeLatLonIndexRowType, zStartBound);564 IndexKeyRange zStartRange = IndexKeyRange.around(beforeLatLonIndexRowType, zStartBound);
561 Operator plan = indexScan_Default(beforeLatLonIndexRowType, false, zStartRange);565 Operator plan = indexScan_Default(beforeLatLonIndexRowType, zStartRange, lookaheadQuantum());
562 Cursor cursor = API.cursor(plan, queryContext, queryBindings);566 Cursor cursor = API.cursor(plan, queryContext, queryBindings);
563 cursor.openTopLevel();567 cursor.openTopLevel();
564 Row row;568 Row row;
@@ -700,7 +704,7 @@
700 IndexBound upperRight = new IndexBound(row(latLonIndexRowType, latHi, lonHi),704 IndexBound upperRight = new IndexBound(row(latLonIndexRowType, latHi, lonHi),
701 new SetColumnSelector(0, 1));705 new SetColumnSelector(0, 1));
702 IndexKeyRange box = IndexKeyRange.spatial(latLonIndexRowType, lowerLeft, upperRight);706 IndexKeyRange box = IndexKeyRange.spatial(latLonIndexRowType, lowerLeft, upperRight);
703 Operator plan = indexScan_Default(latLonIndexRowType, false, box);707 Operator plan = indexScan_Default(latLonIndexRowType, box, lookaheadQuantum());
704 Cursor cursor = API.cursor(plan, queryContext, queryBindings);708 Cursor cursor = API.cursor(plan, queryContext, queryBindings);
705 cursor.openTopLevel();709 cursor.openTopLevel();
706 Row row;710 Row row;
@@ -745,7 +749,7 @@
745 IndexBound upperRight = new IndexBound(row(latLonIndexRowType, latHi, lonHi),749 IndexBound upperRight = new IndexBound(row(latLonIndexRowType, latHi, lonHi),
746 new SetColumnSelector(0, 1));750 new SetColumnSelector(0, 1));
747 IndexKeyRange box = IndexKeyRange.spatial(latLonIndexRowType, lowerLeft, upperRight);751 IndexKeyRange box = IndexKeyRange.spatial(latLonIndexRowType, lowerLeft, upperRight);
748 Operator plan = indexScan_Default(latLonIndexRowType, false, box);752 Operator plan = indexScan_Default(latLonIndexRowType, box, lookaheadQuantum());
749 Cursor cursor = API.cursor(plan, queryContext, queryBindings);753 Cursor cursor = API.cursor(plan, queryContext, queryBindings);
750 cursor.openTopLevel();754 cursor.openTopLevel();
751 Row row;755 Row row;
752756
=== added file 'src/test/java/com/akiban/server/test/it/qp/SpatialLatLonTableIndexScanLookaheadIT.java'
--- src/test/java/com/akiban/server/test/it/qp/SpatialLatLonTableIndexScanLookaheadIT.java 1970-01-01 00:00:00 +0000
+++ src/test/java/com/akiban/server/test/it/qp/SpatialLatLonTableIndexScanLookaheadIT.java 2013-07-18 20:08:26 +0000
@@ -0,0 +1,26 @@
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
20public class SpatialLatLonTableIndexScanLookaheadIT extends SpatialLatLonTableIndexScanIT
21{
22 @Override
23 protected int lookaheadQuantum() {
24 return 10;
25 }
26}

Subscribers

People subscribed via source and target branches