提交 a7e7aea5 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Fix AggregateDataEnvelope.getGeometryColumnIndex() for multiple indexes

上级 dffed9ed
...@@ -46,7 +46,7 @@ class AggregateDataEnvelope extends AggregateData { ...@@ -46,7 +46,7 @@ class AggregateDataEnvelope extends AggregateData {
if (indexes != null) { if (indexes != null) {
for (int i = 1, size = indexes.size(); i < size; i++) { for (int i = 1, size = indexes.size(); i < size; i++) {
Index index = indexes.get(i); Index index = indexes.get(i);
if (index instanceof MVSpatialIndex) { if (index instanceof MVSpatialIndex && index.isFirstColumn(column)) {
return index; return index;
} }
} }
......
...@@ -100,3 +100,19 @@ SELECT ENVELOPE(V) FROM TEST; ...@@ -100,3 +100,19 @@ SELECT ENVELOPE(V) FROM TEST;
DROP TABLE TEST; DROP TABLE TEST;
> ok > ok
-- Test for index selection
CREATE TABLE TEST(G1 GEOMETRY, G2 GEOMETRY) AS (SELECT NULL, 'POINT (1 1)'::GEOMETRY);
> ok
CREATE SPATIAL INDEX G1IDX ON TEST(G1);
> ok
CREATE SPATIAL INDEX G2IDX ON TEST(G2);
> ok
SELECT ENVELOPE(G2) FROM TEST;
>> POINT (1 1)
DROP TABLE TEST;
> ok
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论