Merge lp:~mmcm/akiban-server/pipeline-spatial-index-scan into lp:~akiban-technologies/akiban-server/trunk
- pipeline-spatial-index-scan
- Merge into 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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Thomas Jones-Low | Approve | ||
Review via email: mp+175656@code.launchpad.net |
Commit message
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.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/main/java/com/akiban/qp/memoryadapter/MemoryAdapter.java' |
2 | --- src/main/java/com/akiban/qp/memoryadapter/MemoryAdapter.java 2013-07-09 20:37:04 +0000 |
3 | +++ src/main/java/com/akiban/qp/memoryadapter/MemoryAdapter.java 2013-07-18 20:08:26 +0000 |
4 | @@ -75,7 +75,7 @@ |
5 | @Override |
6 | public RowCursor newIndexCursor(QueryContext context, Index index, |
7 | IndexKeyRange keyRange, Ordering ordering, |
8 | - IndexScanSelector scanSelector, boolean usePValues) { |
9 | + IndexScanSelector scanSelector, boolean usePValues, boolean openAllSubCursors) { |
10 | |
11 | Table table = index.rootMostTable(); |
12 | if (table.isUserTable()) { |
13 | |
14 | === modified file 'src/main/java/com/akiban/qp/operator/API.java' |
15 | --- src/main/java/com/akiban/qp/operator/API.java 2013-07-17 20:34:35 +0000 |
16 | +++ src/main/java/com/akiban/qp/operator/API.java 2013-07-18 20:08:26 +0000 |
17 | @@ -419,6 +419,20 @@ |
18 | |
19 | public static Operator indexScan_Default(IndexRowType indexType, |
20 | IndexKeyRange indexKeyRange, |
21 | + int lookaheadQuantum) |
22 | + { |
23 | + Ordering ordering = new Ordering(); |
24 | + int fields = indexType.nFields(); |
25 | + for (int f = 0; f < fields; f++) { |
26 | + ordering.append(new TPreparedField(indexType.typeInstanceAt(f), f), true); |
27 | + } |
28 | + IndexScanSelector indexScanSelector = IndexScanSelector.leftJoinAfter(indexType.index(), |
29 | + indexType.tableType().userTable()); |
30 | + return indexScan_Default(indexType, indexKeyRange, ordering, indexScanSelector, lookaheadQuantum); |
31 | + } |
32 | + |
33 | + public static Operator indexScan_Default(IndexRowType indexType, |
34 | + IndexKeyRange indexKeyRange, |
35 | Ordering ordering, |
36 | IndexScanSelector indexScanSelector, |
37 | int lookaheadQuantum) |
38 | |
39 | === modified file 'src/main/java/com/akiban/qp/operator/IndexScan_Default.java' |
40 | --- src/main/java/com/akiban/qp/operator/IndexScan_Default.java 2013-07-15 21:16:57 +0000 |
41 | +++ src/main/java/com/akiban/qp/operator/IndexScan_Default.java 2013-07-18 20:08:26 +0000 |
42 | @@ -374,7 +374,7 @@ |
43 | { |
44 | super(context, bindingsCursor); |
45 | UserTable table = (UserTable)index.rootMostTable(); |
46 | - this.cursor = adapter(table).newIndexCursor(context, index, indexKeyRange, ordering, scanSelector, usePValues); |
47 | + this.cursor = adapter(table).newIndexCursor(context, index, indexKeyRange, ordering, scanSelector, usePValues, false); |
48 | } |
49 | |
50 | // Object state |
51 | @@ -576,7 +576,7 @@ |
52 | UserTable table = (UserTable)index.rootMostTable(); |
53 | StoreAdapter adapter = adapter(table); |
54 | for (int i = 0; i < quantum; i++) { |
55 | - RowCursor cursor = adapter.newIndexCursor(context, index, indexKeyRange, ordering, scanSelector, usePValues); |
56 | + RowCursor cursor = adapter.newIndexCursor(context, index, indexKeyRange, ordering, scanSelector, usePValues, true); |
57 | cursorPool.add(cursor); |
58 | } |
59 | } |
60 | |
61 | === modified file 'src/main/java/com/akiban/qp/operator/StoreAdapter.java' |
62 | --- src/main/java/com/akiban/qp/operator/StoreAdapter.java 2013-07-09 20:37:04 +0000 |
63 | +++ src/main/java/com/akiban/qp/operator/StoreAdapter.java 2013-07-18 20:08:26 +0000 |
64 | @@ -57,7 +57,8 @@ |
65 | IndexKeyRange keyRange, |
66 | API.Ordering ordering, |
67 | IndexScanSelector scanSelector, |
68 | - boolean usePValues); |
69 | + boolean usePValues, |
70 | + boolean openAllSubCursors); |
71 | |
72 | public abstract <HKEY extends com.akiban.qp.row.HKey> HKEY newHKey(HKey hKeyMetadata); |
73 | |
74 | |
75 | === modified file 'src/main/java/com/akiban/qp/persistitadapter/PersistitAdapter.java' |
76 | --- src/main/java/com/akiban/qp/persistitadapter/PersistitAdapter.java 2013-07-13 17:12:00 +0000 |
77 | +++ src/main/java/com/akiban/qp/persistitadapter/PersistitAdapter.java 2013-07-18 20:08:26 +0000 |
78 | @@ -72,14 +72,15 @@ |
79 | |
80 | @Override |
81 | public RowCursor newIndexCursor(QueryContext context, Index index, IndexKeyRange keyRange, API.Ordering ordering, |
82 | - IndexScanSelector selector, boolean usePValues) |
83 | + IndexScanSelector selector, boolean usePValues, boolean openAllSubCursors) |
84 | { |
85 | return new PersistitIndexCursor(context, |
86 | schema.indexRowType(index), |
87 | keyRange, |
88 | ordering, |
89 | selector, |
90 | - usePValues); |
91 | + usePValues, |
92 | + openAllSubCursors); |
93 | } |
94 | |
95 | @Override |
96 | |
97 | === modified file 'src/main/java/com/akiban/qp/persistitadapter/PersistitIndexCursor.java' |
98 | --- src/main/java/com/akiban/qp/persistitadapter/PersistitIndexCursor.java 2013-07-09 17:26:33 +0000 |
99 | +++ src/main/java/com/akiban/qp/persistitadapter/PersistitIndexCursor.java 2013-07-18 20:08:26 +0000 |
100 | @@ -116,7 +116,8 @@ |
101 | IndexKeyRange keyRange, |
102 | API.Ordering ordering, |
103 | IndexScanSelector selector, |
104 | - boolean usePValues) |
105 | + boolean usePValues, |
106 | + boolean openAllSubCursors) |
107 | { |
108 | this.keyRange = keyRange; |
109 | this.ordering = ordering; |
110 | @@ -127,7 +128,7 @@ |
111 | this.selector = selector; |
112 | this.idle = true; |
113 | this.rowState = context.getStore().createIterationHelper(indexRowType); |
114 | - this.indexCursor = IndexCursor.create(context, keyRange, ordering, rowState, usePValues); |
115 | + this.indexCursor = IndexCursor.create(context, keyRange, ordering, rowState, usePValues, openAllSubCursors); |
116 | } |
117 | |
118 | // For use by this class |
119 | |
120 | === modified file 'src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursor.java' |
121 | --- src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursor.java 2013-07-09 00:42:04 +0000 |
122 | +++ src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursor.java 2013-07-18 20:08:26 +0000 |
123 | @@ -128,7 +128,8 @@ |
124 | IndexKeyRange keyRange, |
125 | API.Ordering ordering, |
126 | IterationHelper iterationHelper, |
127 | - boolean usePValues) |
128 | + boolean usePValues, |
129 | + boolean openAllSubCursors) |
130 | { |
131 | SortKeyAdapter<?, ?> adapter = |
132 | usePValues |
133 | @@ -138,7 +139,7 @@ |
134 | keyRange != null && keyRange.spatial() |
135 | ? keyRange.hi() == null |
136 | ? IndexCursorSpatial_NearPoint.create(context, iterationHelper, keyRange) |
137 | - : IndexCursorSpatial_InBox.create(context, iterationHelper, keyRange) |
138 | + : IndexCursorSpatial_InBox.create(context, iterationHelper, keyRange, openAllSubCursors) |
139 | : ordering.allAscending() || ordering.allDescending() |
140 | ? (keyRange != null && keyRange.lexicographic() |
141 | ? IndexCursorUnidirectionalLexicographic.create(context, iterationHelper, keyRange, ordering, adapter) |
142 | |
143 | === modified file 'src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursorSpatial_InBox.java' |
144 | --- src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursorSpatial_InBox.java 2013-07-09 17:26:33 +0000 |
145 | +++ src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursorSpatial_InBox.java 2013-07-18 20:08:26 +0000 |
146 | @@ -93,18 +93,19 @@ |
147 | |
148 | public static IndexCursorSpatial_InBox create(QueryContext context, |
149 | IterationHelper iterationHelper, |
150 | - IndexKeyRange keyRange) |
151 | + IndexKeyRange keyRange, |
152 | + boolean openAll) |
153 | { |
154 | - return new IndexCursorSpatial_InBox(context, iterationHelper, keyRange); |
155 | + return new IndexCursorSpatial_InBox(context, iterationHelper, keyRange, openAll); |
156 | } |
157 | |
158 | // For use by this class |
159 | |
160 | - private IndexCursorSpatial_InBox(QueryContext context, IterationHelper iterationHelper, IndexKeyRange keyRange) |
161 | + private IndexCursorSpatial_InBox(QueryContext context, IterationHelper iterationHelper, IndexKeyRange keyRange, boolean openAll) |
162 | { |
163 | super(context, iterationHelper); |
164 | assert keyRange.spatial(); |
165 | - this.multiCursor = new MultiCursor(); |
166 | + this.multiCursor = new MultiCursor(openAll); |
167 | this.iterationHelper = iterationHelper; |
168 | Index spatialIndex = keyRange.indexRowType().index(); |
169 | assert spatialIndex.isSpatial() : spatialIndex; |
170 | |
171 | === modified file 'src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursorSpatial_NearPoint.java' |
172 | --- src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursorSpatial_NearPoint.java 2013-07-09 17:26:33 +0000 |
173 | +++ src/main/java/com/akiban/qp/persistitadapter/indexcursor/IndexCursorSpatial_NearPoint.java 2013-07-18 20:08:26 +0000 |
174 | @@ -51,16 +51,11 @@ |
175 | { |
176 | super.open(); |
177 | // iterationHelper.closeIteration() closes the PersistitIndexCursor, releasing its Exchange. |
178 | - // This iteration uses the Exchanges in the IndexScanRowStates owned by each cursor of the MultiCursor. |
179 | iterationHelper.closeIteration(); |
180 | geCursor.open(); |
181 | - geRow = geCursor.next(); |
182 | - geDistance = distanceFromStart(geRow); |
183 | - geNeedToAdvance = false; |
184 | + geNeedToAdvance = true; |
185 | ltCursor.open(); |
186 | - ltRow = ltCursor.next(); |
187 | - ltDistance = distanceFromStart(ltRow); |
188 | - ltNeedToAdvance = false; |
189 | + ltNeedToAdvance = true; |
190 | } |
191 | |
192 | @Override |
193 | @@ -72,7 +67,8 @@ |
194 | geRow = geCursor.next(); |
195 | geDistance = distanceFromStart(geRow); |
196 | geNeedToAdvance = false; |
197 | - } else if (ltNeedToAdvance) { |
198 | + } |
199 | + if (ltNeedToAdvance) { |
200 | ltRow = ltCursor.next(); |
201 | ltDistance = distanceFromStart(ltRow); |
202 | ltNeedToAdvance = false; |
203 | |
204 | === modified file 'src/main/java/com/akiban/qp/persistitadapter/indexcursor/PersistitSorter.java' |
205 | --- src/main/java/com/akiban/qp/persistitadapter/indexcursor/PersistitSorter.java 2013-07-16 18:27:15 +0000 |
206 | +++ src/main/java/com/akiban/qp/persistitadapter/indexcursor/PersistitSorter.java 2013-07-18 20:08:26 +0000 |
207 | @@ -147,7 +147,7 @@ |
208 | private RowCursor cursor() |
209 | { |
210 | exchange.clear(); |
211 | - IndexCursor indexCursor = IndexCursor.create(context, null, ordering, iterationHelper, usePValues); |
212 | + IndexCursor indexCursor = IndexCursor.create(context, null, ordering, iterationHelper, usePValues, false); |
213 | indexCursor.rebind(bindings); |
214 | return indexCursor; |
215 | } |
216 | |
217 | === modified file 'src/main/java/com/akiban/qp/util/MultiCursor.java' |
218 | --- src/main/java/com/akiban/qp/util/MultiCursor.java 2013-07-09 19:53:07 +0000 |
219 | +++ src/main/java/com/akiban/qp/util/MultiCursor.java 2013-07-18 20:08:26 +0000 |
220 | @@ -34,9 +34,12 @@ |
221 | @Override |
222 | public void open() |
223 | { |
224 | - sealed = false; |
225 | - // TODO: Have a mode where all the cursors get opened so that |
226 | - // they can start in parallel. |
227 | + sealed = true; |
228 | + if (openAll) { |
229 | + for (RowCursor cursor : cursors) { |
230 | + cursor.open(); |
231 | + } |
232 | + } |
233 | cursorIterator = cursors.iterator(); |
234 | startNextCursor(); |
235 | } |
236 | @@ -109,6 +112,14 @@ |
237 | |
238 | // MultiCursor interface |
239 | |
240 | + public MultiCursor() { |
241 | + this(false); |
242 | + } |
243 | + |
244 | + public MultiCursor(boolean openAll) { |
245 | + this.openAll = openAll; |
246 | + } |
247 | + |
248 | public void addCursor(RowCursor cursor) |
249 | { |
250 | if (sealed) { |
251 | @@ -126,7 +137,9 @@ |
252 | current.close(); |
253 | } |
254 | current = cursorIterator.next(); |
255 | - current.open(); |
256 | + if (!openAll) { |
257 | + current.open(); |
258 | + } |
259 | } else { |
260 | current = null; |
261 | } |
262 | @@ -135,6 +148,7 @@ |
263 | // Object state |
264 | |
265 | private final List<RowCursor> cursors = new ArrayList<>(); |
266 | + private final boolean openAll; |
267 | private boolean sealed = false; |
268 | private Iterator<RowCursor> cursorIterator; |
269 | private RowCursor current; |
270 | |
271 | === modified file 'src/test/java/com/akiban/qp/operator/OperatorTestHelper.java' |
272 | --- src/test/java/com/akiban/qp/operator/OperatorTestHelper.java 2013-07-09 20:37:04 +0000 |
273 | +++ src/test/java/com/akiban/qp/operator/OperatorTestHelper.java 2013-07-18 20:08:26 +0000 |
274 | @@ -193,7 +193,8 @@ |
275 | IndexKeyRange keyRange, |
276 | API.Ordering ordering, |
277 | IndexScanSelector selector, |
278 | - boolean usePValues) |
279 | + boolean usePValues, |
280 | + boolean openAllSubCursors) |
281 | { |
282 | throw new UnsupportedOperationException(); |
283 | } |
284 | |
285 | === modified file 'src/test/java/com/akiban/server/test/it/qp/MultiCursorIT.java' |
286 | --- src/test/java/com/akiban/server/test/it/qp/MultiCursorIT.java 2013-07-09 20:37:04 +0000 |
287 | +++ src/test/java/com/akiban/server/test/it/qp/MultiCursorIT.java 2013-07-18 20:08:26 +0000 |
288 | @@ -50,6 +50,14 @@ |
289 | queryBindings = queryContext.createBindings(); |
290 | } |
291 | |
292 | + @Test(expected=IllegalStateException.class) |
293 | + public void testSealed() |
294 | + { |
295 | + MultiCursor multiCursor = multiCursor(); |
296 | + multiCursor.open(); |
297 | + multiCursor.addCursor(new TestCursor(new int[]{})); |
298 | + } |
299 | + |
300 | @Test |
301 | public void testNoCursors() |
302 | { |
303 | @@ -84,7 +92,18 @@ |
304 | @Test |
305 | public void testMultipleCursors() |
306 | { |
307 | - RowCursor multiCursor = multiCursor(new TestCursor(new int[]{}), |
308 | + testMultipleCursors(false); |
309 | + } |
310 | + |
311 | + @Test |
312 | + public void testOpenAll() |
313 | + { |
314 | + testMultipleCursors(true); |
315 | + } |
316 | + |
317 | + private void testMultipleCursors(boolean openAll) { |
318 | + RowCursor multiCursor = multiCursor(openAll, |
319 | + new TestCursor(new int[]{}), |
320 | new TestCursor(new int[]{0, 1, 2}), |
321 | new TestCursor(new int[]{}), |
322 | new TestCursor(new int[]{}), |
323 | @@ -104,7 +123,12 @@ |
324 | |
325 | private MultiCursor multiCursor(TestCursor ... cursors) |
326 | { |
327 | - MultiCursor multiCursor = new MultiCursor(); |
328 | + return multiCursor(false, cursors); |
329 | + } |
330 | + |
331 | + private MultiCursor multiCursor(boolean openAll, TestCursor ... cursors) |
332 | + { |
333 | + MultiCursor multiCursor = new MultiCursor(openAll); |
334 | for (TestCursor cursor : cursors) { |
335 | multiCursor.addCursor(cursor); |
336 | } |
337 | |
338 | === modified file 'src/test/java/com/akiban/server/test/it/qp/SpatialLatLonGroupIndexScanIT.java' |
339 | --- src/test/java/com/akiban/server/test/it/qp/SpatialLatLonGroupIndexScanIT.java 2013-07-09 21:10:22 +0000 |
340 | +++ src/test/java/com/akiban/server/test/it/qp/SpatialLatLonGroupIndexScanIT.java 2013-07-18 20:08:26 +0000 |
341 | @@ -93,6 +93,10 @@ |
342 | queryBindings = queryContext.createBindings(); |
343 | } |
344 | |
345 | + protected int lookaheadQuantum() { |
346 | + return 1; |
347 | + } |
348 | + |
349 | @Test |
350 | public void testLoad() |
351 | { |
352 | @@ -290,7 +294,7 @@ |
353 | IndexBound upperRight = new IndexBound(row(pSpatialIndexRowType, beforeEQ, latHi, lonHi), |
354 | new SetColumnSelector(0, 1, 2)); |
355 | IndexKeyRange box = IndexKeyRange.spatial(pSpatialIndexRowType, lowerLeft, upperRight); |
356 | - Operator plan = indexScan_Default(pSpatialIndexRowType, false, box); |
357 | + Operator plan = indexScan_Default(pSpatialIndexRowType, box, lookaheadQuantum()); |
358 | Cursor cursor = API.cursor(plan, queryContext, queryBindings); |
359 | cursor.openTopLevel(); |
360 | Row row; |
361 | @@ -369,7 +373,7 @@ |
362 | IndexBound upperRight = new IndexBound(row(cSpatialIndexRowType, beforeEQ, latHi, lonHi), |
363 | new SetColumnSelector(0, 1, 2)); |
364 | IndexKeyRange box = IndexKeyRange.spatial(cSpatialIndexRowType, lowerLeft, upperRight); |
365 | - Operator plan = indexScan_Default(cSpatialIndexRowType, false, box); |
366 | + Operator plan = indexScan_Default(cSpatialIndexRowType, box, lookaheadQuantum()); |
367 | Cursor cursor = API.cursor(plan, queryContext, queryBindings); |
368 | cursor.openTopLevel(); |
369 | Row row; |
370 | @@ -424,7 +428,7 @@ |
371 | new IndexBound(row(cSpatialIndexRowType, beforeEQ, queryLat, queryLon), |
372 | new SetColumnSelector(0, 1, 2)); |
373 | IndexKeyRange zStartRange = IndexKeyRange.around(cSpatialIndexRowType, zStartBound); |
374 | - Operator plan = indexScan_Default(cSpatialIndexRowType, false, zStartRange); |
375 | + Operator plan = indexScan_Default(cSpatialIndexRowType, zStartRange, lookaheadQuantum()); |
376 | Cursor cursor = API.cursor(plan, queryContext, queryBindings); |
377 | cursor.openTopLevel(); |
378 | Row row; |
379 | |
380 | === added file 'src/test/java/com/akiban/server/test/it/qp/SpatialLatLonGroupIndexScanLookaheadIT.java' |
381 | --- src/test/java/com/akiban/server/test/it/qp/SpatialLatLonGroupIndexScanLookaheadIT.java 1970-01-01 00:00:00 +0000 |
382 | +++ src/test/java/com/akiban/server/test/it/qp/SpatialLatLonGroupIndexScanLookaheadIT.java 2013-07-18 20:08:26 +0000 |
383 | @@ -0,0 +1,26 @@ |
384 | +/** |
385 | + * Copyright (C) 2009-2013 Akiban Technologies, Inc. |
386 | + * |
387 | + * This program is free software: you can redistribute it and/or modify |
388 | + * it under the terms of the GNU Affero General Public License as published by |
389 | + * the Free Software Foundation, either version 3 of the License, or |
390 | + * (at your option) any later version. |
391 | + * |
392 | + * This program is distributed in the hope that it will be useful, |
393 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
394 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
395 | + * GNU Affero General Public License for more details. |
396 | + * |
397 | + * You should have received a copy of the GNU Affero General Public License |
398 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
399 | + */ |
400 | + |
401 | +package com.akiban.server.test.it.qp; |
402 | + |
403 | +public class SpatialLatLonGroupIndexScanLookaheadIT extends SpatialLatLonGroupIndexScanIT |
404 | +{ |
405 | + @Override |
406 | + protected int lookaheadQuantum() { |
407 | + return 10; |
408 | + } |
409 | +} |
410 | |
411 | === modified file 'src/test/java/com/akiban/server/test/it/qp/SpatialLatLonTableIndexScanIT.java' |
412 | --- src/test/java/com/akiban/server/test/it/qp/SpatialLatLonTableIndexScanIT.java 2013-07-09 21:10:22 +0000 |
413 | +++ src/test/java/com/akiban/server/test/it/qp/SpatialLatLonTableIndexScanIT.java 2013-07-18 20:08:26 +0000 |
414 | @@ -80,6 +80,10 @@ |
415 | queryBindings = queryContext.createBindings(); |
416 | } |
417 | |
418 | + protected int lookaheadQuantum() { |
419 | + return 1; |
420 | + } |
421 | + |
422 | @Test |
423 | public void testLoad() |
424 | { |
425 | @@ -341,7 +345,7 @@ |
426 | IndexBound upperRight = new IndexBound(row(latLonIndexRowType, latHi, lonHi), |
427 | new SetColumnSelector(0, 1)); |
428 | IndexKeyRange box = IndexKeyRange.spatial(latLonIndexRowType, lowerLeft, upperRight); |
429 | - Operator plan = indexScan_Default(latLonIndexRowType, false, box); |
430 | + Operator plan = indexScan_Default(latLonIndexRowType, box, lookaheadQuantum()); |
431 | Cursor cursor = API.cursor(plan, queryContext, queryBindings); |
432 | cursor.openTopLevel(); |
433 | Row row; |
434 | @@ -404,7 +408,7 @@ |
435 | IndexBound upperRight = new IndexBound(row(latLonIndexRowType, latHi, lonHi), |
436 | new SetColumnSelector(0, 1)); |
437 | IndexKeyRange box = IndexKeyRange.spatial(latLonIndexRowType, lowerLeft, upperRight); |
438 | - Operator plan = indexScan_Default(latLonIndexRowType, false, box); |
439 | + Operator plan = indexScan_Default(latLonIndexRowType, box, lookaheadQuantum()); |
440 | Cursor cursor = API.cursor(plan, queryContext, queryBindings); |
441 | cursor.openTopLevel(); |
442 | Row row; |
443 | @@ -469,7 +473,7 @@ |
444 | IndexBound upperRight = new IndexBound(row(beforeLatLonIndexRowType, before, latHi, lonHi), |
445 | new SetColumnSelector(0, 1, 2)); |
446 | IndexKeyRange box = IndexKeyRange.spatial(beforeLatLonIndexRowType, lowerLeft, upperRight); |
447 | - Operator plan = indexScan_Default(beforeLatLonIndexRowType, false, box); |
448 | + Operator plan = indexScan_Default(beforeLatLonIndexRowType, box, lookaheadQuantum()); |
449 | Cursor cursor = API.cursor(plan, queryContext, queryBindings); |
450 | cursor.openTopLevel(); |
451 | Row row; |
452 | @@ -503,7 +507,7 @@ |
453 | IndexBound zStartBound = new IndexBound(row(latLonIndexRowType, queryLat, queryLon), |
454 | new SetColumnSelector(0, 1)); |
455 | IndexKeyRange zStartRange = IndexKeyRange.around(latLonIndexRowType, zStartBound); |
456 | - Operator plan = indexScan_Default(latLonIndexRowType, false, zStartRange); |
457 | + Operator plan = indexScan_Default(latLonIndexRowType, zStartRange, lookaheadQuantum()); |
458 | Cursor cursor = API.cursor(plan, queryContext, queryBindings); |
459 | cursor.openTopLevel(); |
460 | Row row; |
461 | @@ -558,7 +562,7 @@ |
462 | new IndexBound(row(beforeLatLonIndexRowType, before, queryLat, queryLon), |
463 | new SetColumnSelector(0, 1, 2)); |
464 | IndexKeyRange zStartRange = IndexKeyRange.around(beforeLatLonIndexRowType, zStartBound); |
465 | - Operator plan = indexScan_Default(beforeLatLonIndexRowType, false, zStartRange); |
466 | + Operator plan = indexScan_Default(beforeLatLonIndexRowType, zStartRange, lookaheadQuantum()); |
467 | Cursor cursor = API.cursor(plan, queryContext, queryBindings); |
468 | cursor.openTopLevel(); |
469 | Row row; |
470 | @@ -700,7 +704,7 @@ |
471 | IndexBound upperRight = new IndexBound(row(latLonIndexRowType, latHi, lonHi), |
472 | new SetColumnSelector(0, 1)); |
473 | IndexKeyRange box = IndexKeyRange.spatial(latLonIndexRowType, lowerLeft, upperRight); |
474 | - Operator plan = indexScan_Default(latLonIndexRowType, false, box); |
475 | + Operator plan = indexScan_Default(latLonIndexRowType, box, lookaheadQuantum()); |
476 | Cursor cursor = API.cursor(plan, queryContext, queryBindings); |
477 | cursor.openTopLevel(); |
478 | Row row; |
479 | @@ -745,7 +749,7 @@ |
480 | IndexBound upperRight = new IndexBound(row(latLonIndexRowType, latHi, lonHi), |
481 | new SetColumnSelector(0, 1)); |
482 | IndexKeyRange box = IndexKeyRange.spatial(latLonIndexRowType, lowerLeft, upperRight); |
483 | - Operator plan = indexScan_Default(latLonIndexRowType, false, box); |
484 | + Operator plan = indexScan_Default(latLonIndexRowType, box, lookaheadQuantum()); |
485 | Cursor cursor = API.cursor(plan, queryContext, queryBindings); |
486 | cursor.openTopLevel(); |
487 | Row row; |
488 | |
489 | === added file 'src/test/java/com/akiban/server/test/it/qp/SpatialLatLonTableIndexScanLookaheadIT.java' |
490 | --- src/test/java/com/akiban/server/test/it/qp/SpatialLatLonTableIndexScanLookaheadIT.java 1970-01-01 00:00:00 +0000 |
491 | +++ src/test/java/com/akiban/server/test/it/qp/SpatialLatLonTableIndexScanLookaheadIT.java 2013-07-18 20:08:26 +0000 |
492 | @@ -0,0 +1,26 @@ |
493 | +/** |
494 | + * Copyright (C) 2009-2013 Akiban Technologies, Inc. |
495 | + * |
496 | + * This program is free software: you can redistribute it and/or modify |
497 | + * it under the terms of the GNU Affero General Public License as published by |
498 | + * the Free Software Foundation, either version 3 of the License, or |
499 | + * (at your option) any later version. |
500 | + * |
501 | + * This program is distributed in the hope that it will be useful, |
502 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
503 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
504 | + * GNU Affero General Public License for more details. |
505 | + * |
506 | + * You should have received a copy of the GNU Affero General Public License |
507 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
508 | + */ |
509 | + |
510 | +package com.akiban.server.test.it.qp; |
511 | + |
512 | +public class SpatialLatLonTableIndexScanLookaheadIT extends SpatialLatLonTableIndexScanIT |
513 | +{ |
514 | + @Override |
515 | + protected int lookaheadQuantum() { |
516 | + return 10; |
517 | + } |
518 | +} |
Looks as described.