[CP] [MySQL GIS] fix spatial index coveredby keypart generation
This commit is contained in:
@ -9021,49 +9021,81 @@ int ObQueryRange::get_geo_coveredby_keypart(uint32_t input_srid,
|
|||||||
query_range_ctx_->cur_expr_is_precise_ = false;
|
query_range_ctx_->cur_expr_is_precise_ = false;
|
||||||
exec_ctx = query_range_ctx_->exec_ctx_;
|
exec_ctx = query_range_ctx_->exec_ctx_;
|
||||||
}
|
}
|
||||||
ObKeyPartList and_ranges;
|
ObKeyPart *head = nullptr;
|
||||||
|
ObKeyPart *last = nullptr;
|
||||||
|
hash::ObHashSet<uint64_t> cellid_set;
|
||||||
|
if (OB_FAIL(cellid_set.create(128, "CoveredByKeyPart", "HashNode"))) {
|
||||||
|
LOG_WARN("failed to create cellid set", K(ret));
|
||||||
|
} else if (!cellid_set.created()) {
|
||||||
|
ret = OB_NOT_INIT;
|
||||||
|
LOG_WARN("fail to init cellid set", K(ret));
|
||||||
|
}
|
||||||
for (uint64_t i = 0; OB_SUCC(ret) && i < cells.size(); i++) {
|
for (uint64_t i = 0; OB_SUCC(ret) && i < cells.size(); i++) {
|
||||||
ObKeyPart *head = NULL;
|
int hash_ret = cellid_set.exist_refactored(cells[i]);
|
||||||
ObKeyPart *last = NULL;
|
if (OB_HASH_NOT_EXIST == hash_ret) {
|
||||||
if (OB_ISNULL((head = create_new_key_part()))) {
|
ObKeyPart *cell_head = nullptr;
|
||||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
ObKeyPart *cell_last = nullptr;
|
||||||
LOG_ERROR("alloc memory failed", K(ret));
|
if (OB_FAIL(cellid_set.set_refactored(cells[i]))) {
|
||||||
} else {
|
LOG_WARN("failed to add cellid into set", K(ret));
|
||||||
ObObj val;
|
} else if (OB_ISNULL((cell_head = create_new_key_part()))) {
|
||||||
val.set_uint64(cells[i]);
|
|
||||||
head->id_ = out_key_part->id_;
|
|
||||||
head->pos_ = out_key_part->pos_;
|
|
||||||
if (OB_FAIL(get_geo_single_keypart(val, val, *head))) {
|
|
||||||
LOG_WARN("get normal cmp keypart failed", K(ret));
|
|
||||||
} else {
|
|
||||||
last = head;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ObS2Cellids ancestors;
|
|
||||||
if (OB_FAIL(s2object->get_ancestors(cells[i], ancestors))) {
|
|
||||||
LOG_WARN("Get ancestors of cell failed", K(ret));
|
|
||||||
}
|
|
||||||
for (uint64_t i = 0; OB_SUCC(ret) && i < ancestors.size(); i++) {
|
|
||||||
ObKeyPart *tmp = NULL;
|
|
||||||
if (OB_ISNULL((tmp = create_new_key_part()))) {
|
|
||||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||||
LOG_ERROR("alloc memory failed", K(ret));
|
LOG_ERROR("alloc memory failed", K(ret));
|
||||||
} else {
|
} else {
|
||||||
ObObj val;
|
ObObj val;
|
||||||
val.set_uint64(ancestors[i]);
|
val.set_uint64(cells[i]);
|
||||||
tmp->id_ = out_key_part->id_;
|
cell_head->id_ = out_key_part->id_;
|
||||||
tmp->pos_ = out_key_part->pos_;
|
cell_head->pos_ = out_key_part->pos_;
|
||||||
if (OB_FAIL(get_geo_single_keypart(val, val, *tmp))) {
|
if (OB_FAIL(get_geo_single_keypart(val, val, *cell_head))) {
|
||||||
LOG_WARN("get normal cmp keypart failed", K(ret));
|
LOG_WARN("get normal cmp keypart failed", K(ret));
|
||||||
} else {
|
} else {
|
||||||
last->or_next_ = tmp;
|
cell_last = cell_head;
|
||||||
last = tmp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
ObS2Cellids ancestors;
|
||||||
if (!and_ranges.add_last(head)) {
|
if (OB_FAIL(ret)) {
|
||||||
ret = OB_ERR_UNEXPECTED;
|
} else if (OB_FAIL(s2object->get_ancestors(cells[i], ancestors))) {
|
||||||
LOG_WARN("Add key part range failed", K(ret));
|
LOG_WARN("Get ancestors of cell failed", K(ret));
|
||||||
|
}
|
||||||
|
// if cur cellid is exists in set, then it's ancestors also exist in set
|
||||||
|
int hash_ret = OB_HASH_NOT_EXIST;
|
||||||
|
for (uint64_t i = 0; OB_SUCC(ret) && i < ancestors.size(); i++) {
|
||||||
|
hash_ret = cellid_set.exist_refactored(ancestors[i]);
|
||||||
|
if (hash_ret == OB_HASH_NOT_EXIST) {
|
||||||
|
ObKeyPart *tmp = NULL;
|
||||||
|
if (OB_FAIL(cellid_set.set_refactored(ancestors[i]))) {
|
||||||
|
LOG_WARN("failed to add cellid into set", K(ret));
|
||||||
|
} else if (OB_ISNULL((tmp = create_new_key_part()))) {
|
||||||
|
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||||
|
LOG_ERROR("alloc memory failed", K(ret));
|
||||||
|
} else {
|
||||||
|
ObObj val;
|
||||||
|
val.set_uint64(ancestors[i]);
|
||||||
|
tmp->id_ = out_key_part->id_;
|
||||||
|
tmp->pos_ = out_key_part->pos_;
|
||||||
|
if (OB_FAIL(get_geo_single_keypart(val, val, *tmp))) {
|
||||||
|
LOG_WARN("get normal cmp keypart failed", K(ret));
|
||||||
|
} else {
|
||||||
|
cell_last->or_next_ = tmp;
|
||||||
|
cell_last = tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (OB_HASH_EXIST != hash_ret) {
|
||||||
|
ret = hash_ret;
|
||||||
|
LOG_WARN("fail to check if key exist", K(ret), K(ancestors[i]), K(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (OB_SUCC(ret)) {
|
||||||
|
if (OB_ISNULL(head)) {
|
||||||
|
head = cell_head;
|
||||||
|
} else {
|
||||||
|
last->or_next_ = cell_head;
|
||||||
|
}
|
||||||
|
last = cell_last;
|
||||||
|
}
|
||||||
|
} else if (OB_HASH_EXIST != hash_ret) {
|
||||||
|
ret = hash_ret;
|
||||||
|
LOG_WARN("fail to check if key exist", K(ret), K(cells[i]), K(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9075,31 +9107,15 @@ int ObQueryRange::get_geo_coveredby_keypart(uint32_t input_srid,
|
|||||||
} else {
|
} else {
|
||||||
query_range_ctx_ = new(ptr) ObQueryRangeCtx(exec_ctx, NULL, NULL);
|
query_range_ctx_ = new(ptr) ObQueryRangeCtx(exec_ctx, NULL, NULL);
|
||||||
}
|
}
|
||||||
ObKeyPart *temp_result = NULL;
|
|
||||||
ObS2Cellids cells_cover_geo;
|
ObS2Cellids cells_cover_geo;
|
||||||
ObSqlBitSet<> key_offsets;
|
for (uint64_t i = 0; OB_SUCC(ret) && i < cells_cover_geo.size(); i++) {
|
||||||
if (OB_FAIL(ret)) {
|
int hash_ret = cellid_set.exist_refactored(cells_cover_geo[i]);
|
||||||
} else if (OB_FAIL(and_range_graph(and_ranges, temp_result))) {
|
if (OB_HASH_NOT_EXIST == hash_ret) {
|
||||||
LOG_WARN("And query range failed", K(ret));
|
|
||||||
} else if (NULL == temp_result) {
|
|
||||||
// no range left
|
|
||||||
} else if (OB_FAIL(refine_large_range_graph(temp_result))) {
|
|
||||||
LOG_WARN("failed to refine large range graph", K(ret));
|
|
||||||
} else if (OB_FAIL(remove_useless_range_graph(temp_result, key_offsets))) {
|
|
||||||
LOG_WARN("failed to remove useless range", K(ret));
|
|
||||||
} else if (OB_FAIL(s2object->get_cellids(cells_cover_geo, false))) {
|
|
||||||
LOG_WARN("Get cellids from s2object failed", K(ret));
|
|
||||||
} else {
|
|
||||||
// get the last node
|
|
||||||
ObKeyPart *cur = temp_result;
|
|
||||||
ObKeyPart *last = NULL;
|
|
||||||
while (OB_NOT_NULL(cur)) {
|
|
||||||
last = cur;
|
|
||||||
cur = cur->or_next_;
|
|
||||||
}
|
|
||||||
for (uint64_t i = 0; OB_SUCC(ret) && i < cells_cover_geo.size(); i++) {
|
|
||||||
ObKeyPart *tmp = NULL;
|
ObKeyPart *tmp = NULL;
|
||||||
if (OB_ISNULL((tmp = create_new_key_part()))) {
|
if (OB_FAIL(cellid_set.set_refactored(cells_cover_geo[i]))) {
|
||||||
|
LOG_WARN("failed to add cellid into set", K(ret));
|
||||||
|
} else if (OB_ISNULL((tmp = create_new_key_part()))) {
|
||||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||||
LOG_ERROR("alloc memory failed", K(ret));
|
LOG_ERROR("alloc memory failed", K(ret));
|
||||||
} else {
|
} else {
|
||||||
@ -9114,24 +9130,35 @@ int ObQueryRange::get_geo_coveredby_keypart(uint32_t input_srid,
|
|||||||
last = tmp;
|
last = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (OB_HASH_EXIST != hash_ret) {
|
||||||
|
ret = hash_ret;
|
||||||
|
LOG_WARN("fail to check if key exist", K(ret), K(cells_cover_geo[i]), K(i));
|
||||||
}
|
}
|
||||||
// copy temp_result to out_key_part
|
}
|
||||||
if (OB_FAIL(out_key_part->create_normal_key())) {
|
// copy temp_result to out_key_part
|
||||||
LOG_WARN("create normal key failed", K(ret));
|
if (OB_FAIL(ret)) {
|
||||||
} else if (OB_ISNULL(out_key_part->normal_keypart_)) {
|
} else if (OB_FAIL(out_key_part->create_normal_key())) {
|
||||||
ret = OB_ERR_UNEXPECTED;
|
LOG_WARN("create normal key failed", K(ret));
|
||||||
LOG_WARN("normal keypart is null");
|
} else if (OB_ISNULL(out_key_part->normal_keypart_)) {
|
||||||
} else {
|
ret = OB_ERR_UNEXPECTED;
|
||||||
out_key_part->null_safe_ = temp_result->null_safe_;
|
LOG_WARN("normal keypart is null");
|
||||||
out_key_part->normal_keypart_->include_start_ = true;
|
} else {
|
||||||
out_key_part->normal_keypart_->include_end_ = true;
|
out_key_part->null_safe_ = head->null_safe_;
|
||||||
out_key_part->normal_keypart_->start_ = temp_result->normal_keypart_->start_;
|
out_key_part->normal_keypart_->include_start_ = true;
|
||||||
out_key_part->normal_keypart_->end_ = temp_result->normal_keypart_->end_;
|
out_key_part->normal_keypart_->include_end_ = true;
|
||||||
out_key_part->normal_keypart_->always_false_ = false;
|
out_key_part->normal_keypart_->start_ = head->normal_keypart_->start_;
|
||||||
out_key_part->normal_keypart_->always_true_ = false;
|
out_key_part->normal_keypart_->end_ = head->normal_keypart_->end_;
|
||||||
out_key_part->item_next_ = temp_result->item_next_;
|
out_key_part->normal_keypart_->always_false_ = false;
|
||||||
out_key_part->or_next_ = temp_result->or_next_;
|
out_key_part->normal_keypart_->always_true_ = false;
|
||||||
out_key_part->and_next_ = temp_result->and_next_;
|
out_key_part->item_next_ = head->item_next_;
|
||||||
|
out_key_part->or_next_ = head->or_next_;
|
||||||
|
out_key_part->and_next_ = head->and_next_;
|
||||||
|
}
|
||||||
|
// clear hashset
|
||||||
|
if (cellid_set.created()) {
|
||||||
|
int tmp_ret = cellid_set.destroy();
|
||||||
|
if (OB_SUCC(ret) && OB_FAIL(tmp_ret)) {
|
||||||
|
LOG_WARN("failed to destory param set", K(ret));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1192,7 +1192,7 @@ INSERT INTO t (g) VALUES
|
|||||||
(ST_GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))')),
|
(ST_GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))')),
|
||||||
(ST_GeomFromText('MULTIPOLYGON (((0 0, 2 0, 2 2, 0 2, 0 0)), ((2.5 2.5, 6 2.5, 6 6, 2.5 6, 2.5 2.5), (3.5 3, 4.5 3, 4.5 4.5, 3.5 4.5, 3.5 3)))')),
|
(ST_GeomFromText('MULTIPOLYGON (((0 0, 2 0, 2 2, 0 2, 0 0)), ((2.5 2.5, 6 2.5, 6 6, 2.5 6, 2.5 2.5), (3.5 3, 4.5 3, 4.5 4.5, 3.5 4.5, 3.5 3)))')),
|
||||||
(ST_GeomFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(2 2,3 3))'));
|
(ST_GeomFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(2 2,3 3))'));
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('POINT(0 0)'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('POINT(0 0)'));
|
||||||
st_astext(g)
|
st_astext(g)
|
||||||
POINT(0 0)
|
POINT(0 0)
|
||||||
LINESTRING(0 0,1 1)
|
LINESTRING(0 0,1 1)
|
||||||
@ -1201,10 +1201,10 @@ MULTIPOINT((0 0),(1 1))
|
|||||||
MULTILINESTRING((0 0,1 1),(4 4,5 5))
|
MULTILINESTRING((0 0,1 1),(4 4,5 5))
|
||||||
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
||||||
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(2 2,3 3))
|
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(2 2,3 3))
|
||||||
select st_astext(g) from t where _st_covers(ST_GeomFromText('POINT(0 0)'), g);
|
select st_astext(g) from t ignore index(idx) where _st_covers(ST_GeomFromText('POINT(0 0)'), g);
|
||||||
st_astext(g)
|
st_astext(g)
|
||||||
POINT(0 0)
|
POINT(0 0)
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('POINT(1 1)'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('POINT(1 1)'));
|
||||||
st_astext(g)
|
st_astext(g)
|
||||||
POINT(1 1)
|
POINT(1 1)
|
||||||
LINESTRING(0 0,1 1)
|
LINESTRING(0 0,1 1)
|
||||||
@ -1212,52 +1212,52 @@ POLYGON((0 0,10 0,10 5,0 5,0 0))
|
|||||||
MULTIPOINT((0 0),(1 1))
|
MULTIPOINT((0 0),(1 1))
|
||||||
MULTILINESTRING((0 0,1 1),(4 4,5 5))
|
MULTILINESTRING((0 0,1 1),(4 4,5 5))
|
||||||
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('POINT(2 2)'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('POINT(2 2)'));
|
||||||
st_astext(g)
|
st_astext(g)
|
||||||
POINT(2 2)
|
POINT(2 2)
|
||||||
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
||||||
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
||||||
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(2 2,3 3))
|
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(2 2,3 3))
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('POINT(3 3)'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('POINT(3 3)'));
|
||||||
st_astext(g)
|
st_astext(g)
|
||||||
POINT(3 3)
|
POINT(3 3)
|
||||||
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
||||||
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
||||||
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(2 2,3 3))
|
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(2 2,3 3))
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('POINT(4 4)'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('POINT(4 4)'));
|
||||||
st_astext(g)
|
st_astext(g)
|
||||||
POINT(4 4)
|
POINT(4 4)
|
||||||
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
||||||
MULTILINESTRING((0 0,1 1),(4 4,5 5))
|
MULTILINESTRING((0 0,1 1),(4 4,5 5))
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('POINT(5 5)'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('POINT(5 5)'));
|
||||||
st_astext(g)
|
st_astext(g)
|
||||||
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
||||||
MULTILINESTRING((0 0,1 1),(4 4,5 5))
|
MULTILINESTRING((0 0,1 1),(4 4,5 5))
|
||||||
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('LINESTRING(0 0,1 1)'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('LINESTRING(0 0,1 1)'));
|
||||||
st_astext(g)
|
st_astext(g)
|
||||||
LINESTRING(0 0,1 1)
|
LINESTRING(0 0,1 1)
|
||||||
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
||||||
MULTILINESTRING((0 0,1 1),(4 4,5 5))
|
MULTILINESTRING((0 0,1 1),(4 4,5 5))
|
||||||
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))'));
|
||||||
st_astext(g)
|
st_astext(g)
|
||||||
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('MULTIPOINT((0 0), (1 1))'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('MULTIPOINT((0 0), (1 1))'));
|
||||||
st_astext(g)
|
st_astext(g)
|
||||||
LINESTRING(0 0,1 1)
|
LINESTRING(0 0,1 1)
|
||||||
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
||||||
MULTIPOINT((0 0),(1 1))
|
MULTIPOINT((0 0),(1 1))
|
||||||
MULTILINESTRING((0 0,1 1),(4 4,5 5))
|
MULTILINESTRING((0 0,1 1),(4 4,5 5))
|
||||||
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))'));
|
||||||
st_astext(g)
|
st_astext(g)
|
||||||
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
||||||
MULTILINESTRING((0 0,1 1),(4 4,5 5))
|
MULTILINESTRING((0 0,1 1),(4 4,5 5))
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('MULTIPOLYGON (((0 0, 2 0, 2 2, 0 2, 0 0)), ((2.5 2.5, 6 2.5, 6 6, 2.5 6, 2.5 2.5), (3.5 3, 4.5 3, 4.5 4.5, 3.5 4.5, 3.5 3)))'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('MULTIPOLYGON (((0 0, 2 0, 2 2, 0 2, 0 0)), ((2.5 2.5, 6 2.5, 6 6, 2.5 6, 2.5 2.5), (3.5 3, 4.5 3, 4.5 4.5, 3.5 4.5, 3.5 3)))'));
|
||||||
st_astext(g)
|
st_astext(g)
|
||||||
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((2.5 2.5,6 2.5,6 6,2.5 6,2.5 2.5),(3.5 3,4.5 3,4.5 4.5,3.5 4.5,3.5 3)))
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(2 2,3 3))'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(2 2,3 3))'));
|
||||||
st_astext(g)
|
st_astext(g)
|
||||||
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
POLYGON((0 0,10 0,10 5,0 5,0 0))
|
||||||
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(2 2,3 3))
|
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(2 2,3 3))
|
||||||
@ -1518,27 +1518,28 @@ Query Plan
|
|||||||
=================================================
|
=================================================
|
||||||
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
|
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
|0 |TABLE FULL SCAN|t(idx)|1 |527 |
|
|0 |TABLE FULL SCAN|t(idx)|1 |540 |
|
||||||
=================================================
|
=================================================
|
||||||
Outputs & filters:
|
Outputs & filters:
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
0 - output([st_astext(t.g)]), filter([BOOL(_st_covers(t.g, ST_GeomFromText('POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))')))])
|
0 - output([st_astext(t.g)]), filter([BOOL(_st_covers(t.g, ST_GeomFromText('POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))')))])
|
||||||
access([t.__pk_increment], [t.g]), partitions(p0)
|
access([t.__pk_increment], [t.g]), partitions(p0)
|
||||||
is_index_back=true, is_global_index=false, filter_before_indexback[false],
|
is_index_back=true, is_global_index=false, filter_before_indexback[false],
|
||||||
range_key([t.__cellid_16], [t.__mbr_16], [t.__pk_increment]), range(1152921504606846992,MIN,MIN ; 1152921504606846992,MAX,MAX), (1152921504606847040,
|
range_key([t.__cellid_16], [t.__mbr_16], [t.__pk_increment]), range(1152921504606846977,MIN,MIN ; 1152921504606846977,MAX,MAX), (1152921504606846980,
|
||||||
MIN,MIN ; 1152921504606847040,MAX,MAX), (1152921504606847232,MIN,MIN ; 1152921504606847232,MAX,MAX), (1152921504606848000,MIN,MIN ; 1152921504606848000,
|
MIN,MIN ; 1152921504606846980,MAX,MAX), (1152921504606846992,MIN,MIN ; 1152921504606846992,MAX,MAX), (1152921504606847040,MIN,MIN ; 1152921504606847040,
|
||||||
MAX,MAX), (1152921504606851072,MIN,MIN ; 1152921504606851072,MAX,MAX), (1152921504606863360,MIN,MIN ; 1152921504606863360,MAX,MAX), (1152921504606912512,
|
MAX,MAX), (1152921504606847232,MIN,MIN ; 1152921504606847232,MAX,MAX), (1152921504606848000,MIN,MIN ; 1152921504606848000,MAX,MAX), (1152921504606851072,
|
||||||
MIN,MIN ; 1152921504606912512,MAX,MAX), (1152921504607109120,MIN,MIN ; 1152921504607109120,MAX,MAX), (1152921504607895552,MIN,MIN ; 1152921504607895552,
|
MIN,MIN ; 1152921504606851072,MAX,MAX), (1152921504606863360,MIN,MIN ; 1152921504606863360,MAX,MAX), (1152921504606912512,MIN,MIN ; 1152921504606912512,
|
||||||
MAX,MAX), (1152921504611041280,MIN,MIN ; 1152921504611041280,MAX,MAX), (1152921504623624192,MIN,MIN ; 1152921504623624192,MAX,MAX), (1152921504673955840,
|
MAX,MAX), (1152921504607109120,MIN,MIN ; 1152921504607109120,MAX,MAX), (1152921504607895552,MIN,MIN ; 1152921504607895552,MAX,MAX), (1152921504611041280,
|
||||||
MIN,MIN ; 1152921504673955840,MAX,MAX), (1152921504875282432,MIN,MIN ; 1152921504875282432,MAX,MAX), (1152921505680588800,MIN,MIN ; 1152921505680588800,
|
MIN,MIN ; 1152921504611041280,MAX,MAX), (1152921504623624192,MIN,MIN ; 1152921504623624192,MAX,MAX), (1152921504673955840,MIN,MIN ; 1152921504673955840,
|
||||||
MAX,MAX), (1152921508901814272,MIN,MIN ; 1152921508901814272,MAX,MAX), (1152921521786716160,MIN,MIN ; 1152921521786716160,MAX,MAX), (1152921573326323712,
|
MAX,MAX), (1152921504875282432,MIN,MIN ; 1152921504875282432,MAX,MAX), (1152921505680588800,MIN,MIN ; 1152921505680588800,MAX,MAX), (1152921508901814272,
|
||||||
MIN,MIN ; 1152921573326323712,MAX,MAX), (1152921779484753920,MIN,MIN ; 1152921779484753920,MAX,MAX), (1152922604118474752,MIN,MIN ; 1152922604118474752,
|
MIN,MIN ; 1152921508901814272,MAX,MAX), (1152921521786716160,MIN,MIN ; 1152921521786716160,MAX,MAX), (1152921573326323712,MIN,MIN ; 1152921573326323712,
|
||||||
MAX,MAX), (1152925902653358080,MIN,MIN ; 1152925902653358080,MAX,MAX), (1152939096792891392,MIN,MIN ; 1152939096792891392,MAX,MAX), (1152991873351024640,
|
MAX,MAX), (1152921779484753920,MIN,MIN ; 1152921779484753920,MAX,MAX), (1152922604118474752,MIN,MIN ; 1152922604118474752,MAX,MAX), (1152925902653358080,
|
||||||
MIN,MIN ; 1152991873351024640,MAX,MAX), (1153202979583557632,MIN,MIN ; 1153202979583557632,MAX,MAX), (1154047404513689600,MIN,MIN ; 1154047404513689600,
|
MIN,MIN ; 1152925902653358080,MAX,MAX), (1152939096792891392,MIN,MIN ; 1152939096792891392,MAX,MAX), (1152991873351024640,MIN,MIN ; 1152991873351024640,
|
||||||
MAX,MAX), (1157425104234217472,MIN,MIN ; 1157425104234217472,MAX,MAX), (1170935903116328960,MIN,MIN ; 1170935903116328960,MAX,MAX), (1224979098644774912,
|
MAX,MAX), (1153202979583557632,MIN,MIN ; 1153202979583557632,MAX,MAX), (1154047404513689600,MIN,MIN ; 1154047404513689600,MAX,MAX), (1157425104234217472,
|
||||||
MIN,MIN ; 1224979098644774912,MAX,MAX), (1441151880758558720,MIN,MIN ; 1441151880758558720,MAX,MAX), (1152921504606846976,MIN,MIN ; 1152921504606846976,
|
MIN,MIN ; 1157425104234217472,MAX,MAX), (1170935903116328960,MIN,MIN ; 1170935903116328960,MAX,MAX), (1224979098644774912,MIN,MIN ; 1224979098644774912,
|
||||||
MAX,MAX), (1152921504606846980,MIN,MIN ; 1152921504606846980,MAX,MAX), (1152921504606846985,MIN,MIN ; 1152921504606846985,MAX,MAX), (1152921504606846991,
|
MAX,MAX), (1441151880758558720,MIN,MIN ; 1441151880758558720,MAX,MAX), (1152921504606846976,MIN,MIN ; 1152921504606846976,MAX,MAX), (1152921504606846979,
|
||||||
MIN,MIN ; 1152921504606846991,MAX,MAX)
|
MIN,MIN ; 1152921504606846979,MAX,MAX), (1152921504606846985,MIN,MIN ; 1152921504606846985,MAX,MAX), (1152921504606846988,MIN,MIN ; 1152921504606846988,
|
||||||
|
MAX,MAX), (1152921504606846991,MIN,MIN ; 1152921504606846991,MAX,MAX)
|
||||||
Used Hint:
|
Used Hint:
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
/*+
|
/*+
|
||||||
@ -1648,19 +1649,19 @@ Outputs & filters:
|
|||||||
0 - output([st_astext(t.g)]), filter([BOOL(_st_covers(t.g, ST_GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))')))])
|
0 - output([st_astext(t.g)]), filter([BOOL(_st_covers(t.g, ST_GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))')))])
|
||||||
access([t.__pk_increment], [t.g]), partitions(p0)
|
access([t.__pk_increment], [t.g]), partitions(p0)
|
||||||
is_index_back=true, is_global_index=false, filter_before_indexback[false],
|
is_index_back=true, is_global_index=false, filter_before_indexback[false],
|
||||||
range_key([t.__cellid_16], [t.__mbr_16], [t.__pk_increment]), range(1152921504606846980,MIN,MIN ; 1152921504606846980,MAX,MAX), (1152921504606846992,
|
range_key([t.__cellid_16], [t.__mbr_16], [t.__pk_increment]), range(1152921504606846977,MIN,MIN ; 1152921504606846977,MAX,MAX), (1152921504606846980,
|
||||||
MIN,MIN ; 1152921504606846992,MAX,MAX), (1152921504606847040,MIN,MIN ; 1152921504606847040,MAX,MAX), (1152921504606847232,MIN,MIN ; 1152921504606847232,
|
MIN,MIN ; 1152921504606846980,MAX,MAX), (1152921504606846992,MIN,MIN ; 1152921504606846992,MAX,MAX), (1152921504606847040,MIN,MIN ; 1152921504606847040,
|
||||||
MAX,MAX), (1152921504606848000,MIN,MIN ; 1152921504606848000,MAX,MAX), (1152921504606851072,MIN,MIN ; 1152921504606851072,MAX,MAX), (1152921504606863360,
|
MAX,MAX), (1152921504606847232,MIN,MIN ; 1152921504606847232,MAX,MAX), (1152921504606848000,MIN,MIN ; 1152921504606848000,MAX,MAX), (1152921504606851072,
|
||||||
MIN,MIN ; 1152921504606863360,MAX,MAX), (1152921504606912512,MIN,MIN ; 1152921504606912512,MAX,MAX), (1152921504607109120,MIN,MIN ; 1152921504607109120,
|
MIN,MIN ; 1152921504606851072,MAX,MAX), (1152921504606863360,MIN,MIN ; 1152921504606863360,MAX,MAX), (1152921504606912512,MIN,MIN ; 1152921504606912512,
|
||||||
MAX,MAX), (1152921504607895552,MIN,MIN ; 1152921504607895552,MAX,MAX), (1152921504611041280,MIN,MIN ; 1152921504611041280,MAX,MAX), (1152921504623624192,
|
MAX,MAX), (1152921504607109120,MIN,MIN ; 1152921504607109120,MAX,MAX), (1152921504607895552,MIN,MIN ; 1152921504607895552,MAX,MAX), (1152921504611041280,
|
||||||
MIN,MIN ; 1152921504623624192,MAX,MAX), (1152921504673955840,MIN,MIN ; 1152921504673955840,MAX,MAX), (1152921504875282432,MIN,MIN ; 1152921504875282432,
|
MIN,MIN ; 1152921504611041280,MAX,MAX), (1152921504623624192,MIN,MIN ; 1152921504623624192,MAX,MAX), (1152921504673955840,MIN,MIN ; 1152921504673955840,
|
||||||
MAX,MAX), (1152921505680588800,MIN,MIN ; 1152921505680588800,MAX,MAX), (1152921508901814272,MIN,MIN ; 1152921508901814272,MAX,MAX), (1152921521786716160,
|
MAX,MAX), (1152921504875282432,MIN,MIN ; 1152921504875282432,MAX,MAX), (1152921505680588800,MIN,MIN ; 1152921505680588800,MAX,MAX), (1152921508901814272,
|
||||||
MIN,MIN ; 1152921521786716160,MAX,MAX), (1152921573326323712,MIN,MIN ; 1152921573326323712,MAX,MAX), (1152921779484753920,MIN,MIN ; 1152921779484753920,
|
MIN,MIN ; 1152921508901814272,MAX,MAX), (1152921521786716160,MIN,MIN ; 1152921521786716160,MAX,MAX), (1152921573326323712,MIN,MIN ; 1152921573326323712,
|
||||||
MAX,MAX), (1152922604118474752,MIN,MIN ; 1152922604118474752,MAX,MAX), (1152925902653358080,MIN,MIN ; 1152925902653358080,MAX,MAX), (1152939096792891392,
|
MAX,MAX), (1152921779484753920,MIN,MIN ; 1152921779484753920,MAX,MAX), (1152922604118474752,MIN,MIN ; 1152922604118474752,MAX,MAX), (1152925902653358080,
|
||||||
MIN,MIN ; 1152939096792891392,MAX,MAX), (1152991873351024640,MIN,MIN ; 1152991873351024640,MAX,MAX), (1153202979583557632,MIN,MIN ; 1153202979583557632,
|
MIN,MIN ; 1152925902653358080,MAX,MAX), (1152939096792891392,MIN,MIN ; 1152939096792891392,MAX,MAX), (1152991873351024640,MIN,MIN ; 1152991873351024640,
|
||||||
MAX,MAX), (1154047404513689600,MIN,MIN ; 1154047404513689600,MAX,MAX), (1157425104234217472,MIN,MIN ; 1157425104234217472,MAX,MAX), (1170935903116328960,
|
MAX,MAX), (1153202979583557632,MIN,MIN ; 1153202979583557632,MAX,MAX), (1154047404513689600,MIN,MIN ; 1154047404513689600,MAX,MAX), (1157425104234217472,
|
||||||
MIN,MIN ; 1170935903116328960,MAX,MAX), (1224979098644774912,MIN,MIN ; 1224979098644774912,MAX,MAX), (1441151880758558720,MIN,MIN ; 1441151880758558720,
|
MIN,MIN ; 1157425104234217472,MAX,MAX), (1170935903116328960,MIN,MIN ; 1170935903116328960,MAX,MAX), (1224979098644774912,MIN,MIN ; 1224979098644774912,
|
||||||
MAX,MAX), (1152921504606846976,MIN,MIN ; 1152921504606846976,MAX,MAX), (1152921504606846977,MIN,MIN ; 1152921504606846977,MAX,MAX), (1152921504606846981,
|
MAX,MAX), (1441151880758558720,MIN,MIN ; 1441151880758558720,MAX,MAX), (1152921504606846976,MIN,MIN ; 1152921504606846976,MAX,MAX), (1152921504606846981,
|
||||||
MIN,MIN ; 1152921504606846981,MAX,MAX)
|
MIN,MIN ; 1152921504606846981,MAX,MAX)
|
||||||
Used Hint:
|
Used Hint:
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
@ -2612,27 +2613,28 @@ Query Plan
|
|||||||
=================================================
|
=================================================
|
||||||
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
|
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
|0 |TABLE FULL SCAN|t(idx)|1 |527 |
|
|0 |TABLE FULL SCAN|t(idx)|1 |540 |
|
||||||
=================================================
|
=================================================
|
||||||
Outputs & filters:
|
Outputs & filters:
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
0 - output([st_astext(t.g)]), filter([BOOL(ST_Contains(t.g, ST_GeomFromText('POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))')))])
|
0 - output([st_astext(t.g)]), filter([BOOL(ST_Contains(t.g, ST_GeomFromText('POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))')))])
|
||||||
access([t.__pk_increment], [t.g]), partitions(p0)
|
access([t.__pk_increment], [t.g]), partitions(p0)
|
||||||
is_index_back=true, is_global_index=false, filter_before_indexback[false],
|
is_index_back=true, is_global_index=false, filter_before_indexback[false],
|
||||||
range_key([t.__cellid_16], [t.__mbr_16], [t.__pk_increment]), range(1152921504606846992,MIN,MIN ; 1152921504606846992,MAX,MAX), (1152921504606847040,
|
range_key([t.__cellid_16], [t.__mbr_16], [t.__pk_increment]), range(1152921504606846977,MIN,MIN ; 1152921504606846977,MAX,MAX), (1152921504606846980,
|
||||||
MIN,MIN ; 1152921504606847040,MAX,MAX), (1152921504606847232,MIN,MIN ; 1152921504606847232,MAX,MAX), (1152921504606848000,MIN,MIN ; 1152921504606848000,
|
MIN,MIN ; 1152921504606846980,MAX,MAX), (1152921504606846992,MIN,MIN ; 1152921504606846992,MAX,MAX), (1152921504606847040,MIN,MIN ; 1152921504606847040,
|
||||||
MAX,MAX), (1152921504606851072,MIN,MIN ; 1152921504606851072,MAX,MAX), (1152921504606863360,MIN,MIN ; 1152921504606863360,MAX,MAX), (1152921504606912512,
|
MAX,MAX), (1152921504606847232,MIN,MIN ; 1152921504606847232,MAX,MAX), (1152921504606848000,MIN,MIN ; 1152921504606848000,MAX,MAX), (1152921504606851072,
|
||||||
MIN,MIN ; 1152921504606912512,MAX,MAX), (1152921504607109120,MIN,MIN ; 1152921504607109120,MAX,MAX), (1152921504607895552,MIN,MIN ; 1152921504607895552,
|
MIN,MIN ; 1152921504606851072,MAX,MAX), (1152921504606863360,MIN,MIN ; 1152921504606863360,MAX,MAX), (1152921504606912512,MIN,MIN ; 1152921504606912512,
|
||||||
MAX,MAX), (1152921504611041280,MIN,MIN ; 1152921504611041280,MAX,MAX), (1152921504623624192,MIN,MIN ; 1152921504623624192,MAX,MAX), (1152921504673955840,
|
MAX,MAX), (1152921504607109120,MIN,MIN ; 1152921504607109120,MAX,MAX), (1152921504607895552,MIN,MIN ; 1152921504607895552,MAX,MAX), (1152921504611041280,
|
||||||
MIN,MIN ; 1152921504673955840,MAX,MAX), (1152921504875282432,MIN,MIN ; 1152921504875282432,MAX,MAX), (1152921505680588800,MIN,MIN ; 1152921505680588800,
|
MIN,MIN ; 1152921504611041280,MAX,MAX), (1152921504623624192,MIN,MIN ; 1152921504623624192,MAX,MAX), (1152921504673955840,MIN,MIN ; 1152921504673955840,
|
||||||
MAX,MAX), (1152921508901814272,MIN,MIN ; 1152921508901814272,MAX,MAX), (1152921521786716160,MIN,MIN ; 1152921521786716160,MAX,MAX), (1152921573326323712,
|
MAX,MAX), (1152921504875282432,MIN,MIN ; 1152921504875282432,MAX,MAX), (1152921505680588800,MIN,MIN ; 1152921505680588800,MAX,MAX), (1152921508901814272,
|
||||||
MIN,MIN ; 1152921573326323712,MAX,MAX), (1152921779484753920,MIN,MIN ; 1152921779484753920,MAX,MAX), (1152922604118474752,MIN,MIN ; 1152922604118474752,
|
MIN,MIN ; 1152921508901814272,MAX,MAX), (1152921521786716160,MIN,MIN ; 1152921521786716160,MAX,MAX), (1152921573326323712,MIN,MIN ; 1152921573326323712,
|
||||||
MAX,MAX), (1152925902653358080,MIN,MIN ; 1152925902653358080,MAX,MAX), (1152939096792891392,MIN,MIN ; 1152939096792891392,MAX,MAX), (1152991873351024640,
|
MAX,MAX), (1152921779484753920,MIN,MIN ; 1152921779484753920,MAX,MAX), (1152922604118474752,MIN,MIN ; 1152922604118474752,MAX,MAX), (1152925902653358080,
|
||||||
MIN,MIN ; 1152991873351024640,MAX,MAX), (1153202979583557632,MIN,MIN ; 1153202979583557632,MAX,MAX), (1154047404513689600,MIN,MIN ; 1154047404513689600,
|
MIN,MIN ; 1152925902653358080,MAX,MAX), (1152939096792891392,MIN,MIN ; 1152939096792891392,MAX,MAX), (1152991873351024640,MIN,MIN ; 1152991873351024640,
|
||||||
MAX,MAX), (1157425104234217472,MIN,MIN ; 1157425104234217472,MAX,MAX), (1170935903116328960,MIN,MIN ; 1170935903116328960,MAX,MAX), (1224979098644774912,
|
MAX,MAX), (1153202979583557632,MIN,MIN ; 1153202979583557632,MAX,MAX), (1154047404513689600,MIN,MIN ; 1154047404513689600,MAX,MAX), (1157425104234217472,
|
||||||
MIN,MIN ; 1224979098644774912,MAX,MAX), (1441151880758558720,MIN,MIN ; 1441151880758558720,MAX,MAX), (1152921504606846976,MIN,MIN ; 1152921504606846976,
|
MIN,MIN ; 1157425104234217472,MAX,MAX), (1170935903116328960,MIN,MIN ; 1170935903116328960,MAX,MAX), (1224979098644774912,MIN,MIN ; 1224979098644774912,
|
||||||
MAX,MAX), (1152921504606846980,MIN,MIN ; 1152921504606846980,MAX,MAX), (1152921504606846985,MIN,MIN ; 1152921504606846985,MAX,MAX), (1152921504606846991,
|
MAX,MAX), (1441151880758558720,MIN,MIN ; 1441151880758558720,MAX,MAX), (1152921504606846976,MIN,MIN ; 1152921504606846976,MAX,MAX), (1152921504606846979,
|
||||||
MIN,MIN ; 1152921504606846991,MAX,MAX)
|
MIN,MIN ; 1152921504606846979,MAX,MAX), (1152921504606846985,MIN,MIN ; 1152921504606846985,MAX,MAX), (1152921504606846988,MIN,MIN ; 1152921504606846988,
|
||||||
|
MAX,MAX), (1152921504606846991,MIN,MIN ; 1152921504606846991,MAX,MAX)
|
||||||
Used Hint:
|
Used Hint:
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
/*+
|
/*+
|
||||||
@ -2742,19 +2744,19 @@ Outputs & filters:
|
|||||||
0 - output([st_astext(t.g)]), filter([BOOL(ST_Contains(t.g, ST_GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))')))])
|
0 - output([st_astext(t.g)]), filter([BOOL(ST_Contains(t.g, ST_GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))')))])
|
||||||
access([t.__pk_increment], [t.g]), partitions(p0)
|
access([t.__pk_increment], [t.g]), partitions(p0)
|
||||||
is_index_back=true, is_global_index=false, filter_before_indexback[false],
|
is_index_back=true, is_global_index=false, filter_before_indexback[false],
|
||||||
range_key([t.__cellid_16], [t.__mbr_16], [t.__pk_increment]), range(1152921504606846980,MIN,MIN ; 1152921504606846980,MAX,MAX), (1152921504606846992,
|
range_key([t.__cellid_16], [t.__mbr_16], [t.__pk_increment]), range(1152921504606846977,MIN,MIN ; 1152921504606846977,MAX,MAX), (1152921504606846980,
|
||||||
MIN,MIN ; 1152921504606846992,MAX,MAX), (1152921504606847040,MIN,MIN ; 1152921504606847040,MAX,MAX), (1152921504606847232,MIN,MIN ; 1152921504606847232,
|
MIN,MIN ; 1152921504606846980,MAX,MAX), (1152921504606846992,MIN,MIN ; 1152921504606846992,MAX,MAX), (1152921504606847040,MIN,MIN ; 1152921504606847040,
|
||||||
MAX,MAX), (1152921504606848000,MIN,MIN ; 1152921504606848000,MAX,MAX), (1152921504606851072,MIN,MIN ; 1152921504606851072,MAX,MAX), (1152921504606863360,
|
MAX,MAX), (1152921504606847232,MIN,MIN ; 1152921504606847232,MAX,MAX), (1152921504606848000,MIN,MIN ; 1152921504606848000,MAX,MAX), (1152921504606851072,
|
||||||
MIN,MIN ; 1152921504606863360,MAX,MAX), (1152921504606912512,MIN,MIN ; 1152921504606912512,MAX,MAX), (1152921504607109120,MIN,MIN ; 1152921504607109120,
|
MIN,MIN ; 1152921504606851072,MAX,MAX), (1152921504606863360,MIN,MIN ; 1152921504606863360,MAX,MAX), (1152921504606912512,MIN,MIN ; 1152921504606912512,
|
||||||
MAX,MAX), (1152921504607895552,MIN,MIN ; 1152921504607895552,MAX,MAX), (1152921504611041280,MIN,MIN ; 1152921504611041280,MAX,MAX), (1152921504623624192,
|
MAX,MAX), (1152921504607109120,MIN,MIN ; 1152921504607109120,MAX,MAX), (1152921504607895552,MIN,MIN ; 1152921504607895552,MAX,MAX), (1152921504611041280,
|
||||||
MIN,MIN ; 1152921504623624192,MAX,MAX), (1152921504673955840,MIN,MIN ; 1152921504673955840,MAX,MAX), (1152921504875282432,MIN,MIN ; 1152921504875282432,
|
MIN,MIN ; 1152921504611041280,MAX,MAX), (1152921504623624192,MIN,MIN ; 1152921504623624192,MAX,MAX), (1152921504673955840,MIN,MIN ; 1152921504673955840,
|
||||||
MAX,MAX), (1152921505680588800,MIN,MIN ; 1152921505680588800,MAX,MAX), (1152921508901814272,MIN,MIN ; 1152921508901814272,MAX,MAX), (1152921521786716160,
|
MAX,MAX), (1152921504875282432,MIN,MIN ; 1152921504875282432,MAX,MAX), (1152921505680588800,MIN,MIN ; 1152921505680588800,MAX,MAX), (1152921508901814272,
|
||||||
MIN,MIN ; 1152921521786716160,MAX,MAX), (1152921573326323712,MIN,MIN ; 1152921573326323712,MAX,MAX), (1152921779484753920,MIN,MIN ; 1152921779484753920,
|
MIN,MIN ; 1152921508901814272,MAX,MAX), (1152921521786716160,MIN,MIN ; 1152921521786716160,MAX,MAX), (1152921573326323712,MIN,MIN ; 1152921573326323712,
|
||||||
MAX,MAX), (1152922604118474752,MIN,MIN ; 1152922604118474752,MAX,MAX), (1152925902653358080,MIN,MIN ; 1152925902653358080,MAX,MAX), (1152939096792891392,
|
MAX,MAX), (1152921779484753920,MIN,MIN ; 1152921779484753920,MAX,MAX), (1152922604118474752,MIN,MIN ; 1152922604118474752,MAX,MAX), (1152925902653358080,
|
||||||
MIN,MIN ; 1152939096792891392,MAX,MAX), (1152991873351024640,MIN,MIN ; 1152991873351024640,MAX,MAX), (1153202979583557632,MIN,MIN ; 1153202979583557632,
|
MIN,MIN ; 1152925902653358080,MAX,MAX), (1152939096792891392,MIN,MIN ; 1152939096792891392,MAX,MAX), (1152991873351024640,MIN,MIN ; 1152991873351024640,
|
||||||
MAX,MAX), (1154047404513689600,MIN,MIN ; 1154047404513689600,MAX,MAX), (1157425104234217472,MIN,MIN ; 1157425104234217472,MAX,MAX), (1170935903116328960,
|
MAX,MAX), (1153202979583557632,MIN,MIN ; 1153202979583557632,MAX,MAX), (1154047404513689600,MIN,MIN ; 1154047404513689600,MAX,MAX), (1157425104234217472,
|
||||||
MIN,MIN ; 1170935903116328960,MAX,MAX), (1224979098644774912,MIN,MIN ; 1224979098644774912,MAX,MAX), (1441151880758558720,MIN,MIN ; 1441151880758558720,
|
MIN,MIN ; 1157425104234217472,MAX,MAX), (1170935903116328960,MIN,MIN ; 1170935903116328960,MAX,MAX), (1224979098644774912,MIN,MIN ; 1224979098644774912,
|
||||||
MAX,MAX), (1152921504606846976,MIN,MIN ; 1152921504606846976,MAX,MAX), (1152921504606846977,MIN,MIN ; 1152921504606846977,MAX,MAX), (1152921504606846981,
|
MAX,MAX), (1441151880758558720,MIN,MIN ; 1441151880758558720,MAX,MAX), (1152921504606846976,MIN,MIN ; 1152921504606846976,MAX,MAX), (1152921504606846981,
|
||||||
MIN,MIN ; 1152921504606846981,MAX,MAX)
|
MIN,MIN ; 1152921504606846981,MAX,MAX)
|
||||||
Used Hint:
|
Used Hint:
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
@ -3138,3 +3140,51 @@ id st_astext(g)
|
|||||||
4 POINT(5.00001 5)
|
4 POINT(5.00001 5)
|
||||||
7 MULTIPOINT((5.00001 5))
|
7 MULTIPOINT((5.00001 5))
|
||||||
drop table geo_t1;
|
drop table geo_t1;
|
||||||
|
bugfix: 53822176
|
||||||
|
drop table if exists spatial_point_in_line;
|
||||||
|
create table spatial_point_in_line (
|
||||||
|
`id` int unsigned not null auto_increment primary key ,
|
||||||
|
`min` int unsigned not null default 0,
|
||||||
|
`max` int unsigned not null default 0,
|
||||||
|
`line_geo` geometry not null srid 0,
|
||||||
|
SPATIAL INDEX index_spatial_line_geo(`line_geo`)
|
||||||
|
);
|
||||||
|
insert into spatial_point_in_line (min, max, line_geo) values
|
||||||
|
(80, 90, LineString(Point(min, 0), Point(max, 0))),
|
||||||
|
(80, 100, LineString(Point(min, 0), Point(max, 0))),
|
||||||
|
(90, 100, LineString(Point(min, 0), Point(max, 0))),
|
||||||
|
(100, 110, LineString(Point(min, 0), Point(max, 0))),
|
||||||
|
(100, 120, LineString(Point(min, 0), Point(max, 0)));
|
||||||
|
select id, min, max, st_astext(line_geo) from spatial_point_in_line where ST_Contains(line_geo, LineString(Point(80, 0), Point(91, 0)));
|
||||||
|
id min max st_astext(line_geo)
|
||||||
|
2 80 100 LINESTRING(80 0,100 0)
|
||||||
|
explain select id, min, max, st_astext(line_geo) from spatial_point_in_line where ST_Contains(line_geo, LineString(Point(80, 0), Point(91, 0)));
|
||||||
|
Query Plan
|
||||||
|
========================================================================================
|
||||||
|
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
|
||||||
|
----------------------------------------------------------------------------------------
|
||||||
|
|0 |TABLE FULL SCAN|spatial_point_in_line(index_spatial_line_geo)|1 |279 |
|
||||||
|
========================================================================================
|
||||||
|
Outputs & filters:
|
||||||
|
-------------------------------------
|
||||||
|
0 - output([spatial_point_in_line.id], [spatial_point_in_line.min], [spatial_point_in_line.max], [st_astext(spatial_point_in_line.line_geo)]), filter([ST_Contains(spatial_point_in_line.line_geo,
|
||||||
|
linestring(point(cast(80, DOUBLE(-1, -1)), cast(0, DOUBLE(-1, -1))), point(cast(91, DOUBLE(-1, -1)), cast(0, DOUBLE(-1, -1)))))])
|
||||||
|
access([spatial_point_in_line.id], [spatial_point_in_line.line_geo], [spatial_point_in_line.min], [spatial_point_in_line.max]), partitions(p0)
|
||||||
|
is_index_back=true, is_global_index=false, filter_before_indexback[false],
|
||||||
|
range_key([spatial_point_in_line.__cellid_19], [spatial_point_in_line.__mbr_19], [spatial_point_in_line.id]), range(1152921504606848865,MIN,MIN ;
|
||||||
|
1152921504606848865,MAX,MAX), (1152921504606848868,MIN,MIN ; 1152921504606848868,MAX,MAX), (1152921504606848880,MIN,MIN ; 1152921504606848880,MAX,MAX),
|
||||||
|
(1152921504606848832,MIN,MIN ; 1152921504606848832,MAX,MAX), (1152921504606848768,MIN,MIN ; 1152921504606848768,MAX,MAX), (1152921504606848000,MIN,MIN ;
|
||||||
|
1152921504606848000,MAX,MAX), (1152921504606851072,MIN,MIN ; 1152921504606851072,MAX,MAX), (1152921504606863360,MIN,MIN ; 1152921504606863360,MAX,MAX),
|
||||||
|
(1152921504606912512,MIN,MIN ; 1152921504606912512,MAX,MAX), (1152921504607109120,MIN,MIN ; 1152921504607109120,MAX,MAX), (1152921504607895552,MIN,MIN ;
|
||||||
|
1152921504607895552,MAX,MAX), (1152921504611041280,MIN,MIN ; 1152921504611041280,MAX,MAX), (1152921504623624192,MIN,MIN ; 1152921504623624192,MAX,MAX),
|
||||||
|
(1152921504673955840,MIN,MIN ; 1152921504673955840,MAX,MAX), (1152921504875282432,MIN,MIN ; 1152921504875282432,MAX,MAX), (1152921505680588800,MIN,MIN ;
|
||||||
|
1152921505680588800,MAX,MAX), (1152921508901814272,MIN,MIN ; 1152921508901814272,MAX,MAX), (1152921521786716160,MIN,MIN ; 1152921521786716160,MAX,MAX),
|
||||||
|
(1152921573326323712,MIN,MIN ; 1152921573326323712,MAX,MAX), (1152921779484753920,MIN,MIN ; 1152921779484753920,MAX,MAX), (1152922604118474752,MIN,MIN ;
|
||||||
|
1152922604118474752,MAX,MAX), (1152925902653358080,MIN,MIN ; 1152925902653358080,MAX,MAX), (1152939096792891392,MIN,MIN ; 1152939096792891392,MAX,MAX),
|
||||||
|
(1152991873351024640,MIN,MIN ; 1152991873351024640,MAX,MAX), (1153202979583557632,MIN,MIN ; 1153202979583557632,MAX,MAX), (1154047404513689600,MIN,MIN ;
|
||||||
|
1154047404513689600,MAX,MAX), (1157425104234217472,MIN,MIN ; 1157425104234217472,MAX,MAX), (1170935903116328960,MIN,MIN ; 1170935903116328960,MAX,MAX),
|
||||||
|
(1224979098644774912,MIN,MIN ; 1224979098644774912,MAX,MAX), (1441151880758558720,MIN,MIN ; 1441151880758558720,MAX,MAX), (1152921504606846976,MIN,MIN ;
|
||||||
|
1152921504606846976,MAX,MAX), (1152921504606848893,MIN,MIN ; 1152921504606848893,MAX,MAX), (1152921504606848892,MIN,MIN ; 1152921504606848892,MAX,MAX)
|
||||||
|
select id, min, max, st_astext(line_geo) from spatial_point_in_line ignore index(geom_idx_1) where ST_Contains(line_geo, LineString(Point(80, 0), Point(91, 0)));
|
||||||
|
id min max st_astext(line_geo)
|
||||||
|
2 80 100 LINESTRING(80 0,100 0)
|
||||||
|
|||||||
@ -1,47 +1,47 @@
|
|||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Base test of GEOMETRY spatial index.
|
# Base test of GEOMETRY spatial index.
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
DROP TABLE IF EXISTS t1;
|
DROP TABLE IF EXISTS partition_t1;
|
||||||
create table t1(c1 int primary key, g geometry not null srid 0) partition by hash(c1) partitions 2;
|
create table partition_t1(c1 int primary key, g geometry not null srid 0) partition by hash(c1) partitions 2;
|
||||||
create spatial index idx on t1 (g) local;
|
create spatial index idx on partition_t1 (g) local;
|
||||||
insert into t1 (c1, g) values (0, st_geomfromtext('point(1 1)'));
|
insert into partition_t1 (c1, g) values (0, st_geomfromtext('point(1 1)'));
|
||||||
explain select /*+index(t1 idx)*/ st_astext(g) from t1 where st_intersects(g, st_geomfromtext('point(1 1)'));
|
explain select /*+index(partition_t1 idx)*/ st_astext(g) from partition_t1 where st_intersects(g, st_geomfromtext('point(1 1)'));
|
||||||
Query Plan
|
Query Plan
|
||||||
=============================================================
|
======================================================================
|
||||||
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
|
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
|
||||||
-------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|0 |PX COORDINATOR | |1 |291 |
|
|0 |PX COORDINATOR | |1 |291 |
|
||||||
|1 |└─EXCHANGE OUT DISTR |:EX10000|1 |291 |
|
|1 |└─EXCHANGE OUT DISTR |:EX10000 |1 |291 |
|
||||||
|2 | └─PX PARTITION ITERATOR| |1 |289 |
|
|2 | └─PX PARTITION ITERATOR| |1 |289 |
|
||||||
|3 | └─TABLE FULL SCAN |t1(idx) |1 |289 |
|
|3 | └─TABLE FULL SCAN |partition_t1(idx)|1 |289 |
|
||||||
=============================================================
|
======================================================================
|
||||||
Outputs & filters:
|
Outputs & filters:
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
0 - output([INTERNAL_FUNCTION(st_astext(t1.g))]), filter(nil)
|
0 - output([INTERNAL_FUNCTION(st_astext(partition_t1.g))]), filter(nil)
|
||||||
1 - output([INTERNAL_FUNCTION(st_astext(t1.g))]), filter(nil)
|
1 - output([INTERNAL_FUNCTION(st_astext(partition_t1.g))]), filter(nil)
|
||||||
dop=1
|
dop=1
|
||||||
2 - output([t1.g]), filter(nil)
|
2 - output([partition_t1.g]), filter(nil)
|
||||||
force partition granule
|
force partition granule
|
||||||
3 - output([t1.g]), filter([st_intersects(t1.g, st_geomfromtext('point(1 1)'))])
|
3 - output([partition_t1.g]), filter([st_intersects(partition_t1.g, st_geomfromtext('point(1 1)'))])
|
||||||
access([t1.c1], [t1.g]), partitions(p[0-1])
|
access([partition_t1.c1], [partition_t1.g]), partitions(p[0-1])
|
||||||
is_index_back=true, is_global_index=false, filter_before_indexback[false],
|
is_index_back=true, is_global_index=false, filter_before_indexback[false],
|
||||||
range_key([t1.__cellid_17], [t1.__mbr_17], [t1.c1]), range(1152921504606846977,MIN,MIN ; 1152921504606846977,MAX,MAX), (1152921504606846980,MIN,MIN
|
range_key([partition_t1.__cellid_17], [partition_t1.__mbr_17], [partition_t1.c1]), range(1152921504606846977,MIN,MIN ; 1152921504606846977,MAX,MAX),
|
||||||
; 1152921504606846980,MAX,MAX), (1152921504606846992,MIN,MIN ; 1152921504606846992,MAX,MAX), (1152921504606847040,MIN,MIN ; 1152921504606847040,MAX,MAX),
|
(1152921504606846980,MIN,MIN ; 1152921504606846980,MAX,MAX), (1152921504606846992,MIN,MIN ; 1152921504606846992,MAX,MAX), (1152921504606847040,MIN,MIN
|
||||||
(1152921504606847232,MIN,MIN ; 1152921504606847232,MAX,MAX), (1152921504606848000,MIN,MIN ; 1152921504606848000,MAX,MAX), (1152921504606851072,MIN,MIN
|
; 1152921504606847040,MAX,MAX), (1152921504606847232,MIN,MIN ; 1152921504606847232,MAX,MAX), (1152921504606848000,MIN,MIN ; 1152921504606848000,MAX,MAX),
|
||||||
; 1152921504606851072,MAX,MAX), (1152921504606863360,MIN,MIN ; 1152921504606863360,MAX,MAX), (1152921504606912512,MIN,MIN ; 1152921504606912512,MAX,MAX),
|
(1152921504606851072,MIN,MIN ; 1152921504606851072,MAX,MAX), (1152921504606863360,MIN,MIN ; 1152921504606863360,MAX,MAX), (1152921504606912512,MIN,MIN
|
||||||
(1152921504607109120,MIN,MIN ; 1152921504607109120,MAX,MAX), (1152921504607895552,MIN,MIN ; 1152921504607895552,MAX,MAX), (1152921504611041280,MIN,MIN
|
; 1152921504606912512,MAX,MAX), (1152921504607109120,MIN,MIN ; 1152921504607109120,MAX,MAX), (1152921504607895552,MIN,MIN ; 1152921504607895552,MAX,MAX),
|
||||||
; 1152921504611041280,MAX,MAX), (1152921504623624192,MIN,MIN ; 1152921504623624192,MAX,MAX), (1152921504673955840,MIN,MIN ; 1152921504673955840,MAX,MAX),
|
(1152921504611041280,MIN,MIN ; 1152921504611041280,MAX,MAX), (1152921504623624192,MIN,MIN ; 1152921504623624192,MAX,MAX), (1152921504673955840,MIN,MIN
|
||||||
(1152921504875282432,MIN,MIN ; 1152921504875282432,MAX,MAX), (1152921505680588800,MIN,MIN ; 1152921505680588800,MAX,MAX), (1152921508901814272,MIN,MIN
|
; 1152921504673955840,MAX,MAX), (1152921504875282432,MIN,MIN ; 1152921504875282432,MAX,MAX), (1152921505680588800,MIN,MIN ; 1152921505680588800,MAX,MAX),
|
||||||
; 1152921508901814272,MAX,MAX), (1152921521786716160,MIN,MIN ; 1152921521786716160,MAX,MAX), (1152921573326323712,MIN,MIN ; 1152921573326323712,MAX,MAX),
|
(1152921508901814272,MIN,MIN ; 1152921508901814272,MAX,MAX), (1152921521786716160,MIN,MIN ; 1152921521786716160,MAX,MAX), (1152921573326323712,MIN,MIN
|
||||||
(1152921779484753920,MIN,MIN ; 1152921779484753920,MAX,MAX), (1152922604118474752,MIN,MIN ; 1152922604118474752,MAX,MAX), (1152925902653358080,MIN,MIN
|
; 1152921573326323712,MAX,MAX), (1152921779484753920,MIN,MIN ; 1152921779484753920,MAX,MAX), (1152922604118474752,MIN,MIN ; 1152922604118474752,MAX,MAX),
|
||||||
; 1152925902653358080,MAX,MAX), (1152939096792891392,MIN,MIN ; 1152939096792891392,MAX,MAX), (1152991873351024640,MIN,MIN ; 1152991873351024640,MAX,MAX),
|
(1152925902653358080,MIN,MIN ; 1152925902653358080,MAX,MAX), (1152939096792891392,MIN,MIN ; 1152939096792891392,MAX,MAX), (1152991873351024640,MIN,MIN
|
||||||
(1153202979583557632,MIN,MIN ; 1153202979583557632,MAX,MAX), (1154047404513689600,MIN,MIN ; 1154047404513689600,MAX,MAX), (1157425104234217472,MIN,MIN
|
; 1152991873351024640,MAX,MAX), (1153202979583557632,MIN,MIN ; 1153202979583557632,MAX,MAX), (1154047404513689600,MIN,MIN ; 1154047404513689600,MAX,MAX),
|
||||||
; 1157425104234217472,MAX,MAX), (1170935903116328960,MIN,MIN ; 1170935903116328960,MAX,MAX), (1224979098644774912,MIN,MIN ; 1224979098644774912,MAX,MAX),
|
(1157425104234217472,MIN,MIN ; 1157425104234217472,MAX,MAX), (1170935903116328960,MIN,MIN ; 1170935903116328960,MAX,MAX), (1224979098644774912,MIN,MIN
|
||||||
(1441151880758558720,MIN,MIN ; 1441151880758558720,MAX,MAX), (1152921504606846976,MIN,MIN ; 1152921504606846976,MAX,MAX)
|
; 1224979098644774912,MAX,MAX), (1441151880758558720,MIN,MIN ; 1441151880758558720,MAX,MAX), (1152921504606846976,MIN,MIN ; 1152921504606846976,MAX,MAX)
|
||||||
select /*+index(t1 idx)*/ st_astext(g) from t1 where st_intersects(g, st_geomfromtext('point(1 1)'));
|
select /*+index(partition_t1 idx)*/ st_astext(g) from partition_t1 where st_intersects(g, st_geomfromtext('point(1 1)'));
|
||||||
st_astext(g)
|
st_astext(g)
|
||||||
POINT(1 1)
|
POINT(1 1)
|
||||||
drop table t1;
|
drop table partition_t1;
|
||||||
DROP TABLE IF EXISTS t1;
|
DROP TABLE IF EXISTS t1;
|
||||||
create table t1(c1 int primary key, g geometry not null srid 0) partition by range(c1) ( partition p0 values less than (4),
|
create table t1(c1 int primary key, g geometry not null srid 0) partition by range(c1) ( partition p0 values less than (4),
|
||||||
partition p1 values less than (10));
|
partition p1 values less than (10));
|
||||||
|
|||||||
@ -312,19 +312,19 @@ INSERT INTO t (g) VALUES
|
|||||||
(ST_GeomFromText('MULTIPOLYGON (((0 0, 2 0, 2 2, 0 2, 0 0)), ((2.5 2.5, 6 2.5, 6 6, 2.5 6, 2.5 2.5), (3.5 3, 4.5 3, 4.5 4.5, 3.5 4.5, 3.5 3)))')),
|
(ST_GeomFromText('MULTIPOLYGON (((0 0, 2 0, 2 2, 0 2, 0 0)), ((2.5 2.5, 6 2.5, 6 6, 2.5 6, 2.5 2.5), (3.5 3, 4.5 3, 4.5 4.5, 3.5 4.5, 3.5 3)))')),
|
||||||
(ST_GeomFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(2 2,3 3))'));
|
(ST_GeomFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(2 2,3 3))'));
|
||||||
|
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('POINT(0 0)'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('POINT(0 0)'));
|
||||||
select st_astext(g) from t where _st_covers(ST_GeomFromText('POINT(0 0)'), g);
|
select st_astext(g) from t ignore index(idx) where _st_covers(ST_GeomFromText('POINT(0 0)'), g);
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('POINT(1 1)'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('POINT(1 1)'));
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('POINT(2 2)'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('POINT(2 2)'));
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('POINT(3 3)'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('POINT(3 3)'));
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('POINT(4 4)'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('POINT(4 4)'));
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('POINT(5 5)'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('POINT(5 5)'));
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('LINESTRING(0 0,1 1)'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('LINESTRING(0 0,1 1)'));
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))'));
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('MULTIPOINT((0 0), (1 1))'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('MULTIPOINT((0 0), (1 1))'));
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('MULTILINESTRING((0 0, 1 1), (4 4, 5 5))'));
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('MULTIPOLYGON (((0 0, 2 0, 2 2, 0 2, 0 0)), ((2.5 2.5, 6 2.5, 6 6, 2.5 6, 2.5 2.5), (3.5 3, 4.5 3, 4.5 4.5, 3.5 4.5, 3.5 3)))'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('MULTIPOLYGON (((0 0, 2 0, 2 2, 0 2, 0 0)), ((2.5 2.5, 6 2.5, 6 6, 2.5 6, 2.5 2.5), (3.5 3, 4.5 3, 4.5 4.5, 3.5 4.5, 3.5 3)))'));
|
||||||
select st_astext(g) from t where _st_covers(g, ST_GeomFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(2 2,3 3))'));
|
select st_astext(g) from t ignore index(idx) where _st_covers(g, ST_GeomFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(2 2,3 3))'));
|
||||||
|
|
||||||
|
|
||||||
select /*+index(t idx)*/ st_astext(g) from t where _st_covers(g, ST_GeomFromText('POINT(0 0)'));
|
select /*+index(t idx)*/ st_astext(g) from t where _st_covers(g, ST_GeomFromText('POINT(0 0)'));
|
||||||
@ -487,4 +487,26 @@ select id, st_astext(g) from geo_t1 FORCE INDEX(g_idx) where st_within(g, ST_Geo
|
|||||||
select id, st_astext(g) from geo_t1 IGNORE INDEX(g_idx) where _st_covers(ST_GeomFromText('POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))', 4326, 'axis-order=long-lat'), g);
|
select id, st_astext(g) from geo_t1 IGNORE INDEX(g_idx) where _st_covers(ST_GeomFromText('POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))', 4326, 'axis-order=long-lat'), g);
|
||||||
select id, st_astext(g) from geo_t1 FORCE INDEX(g_idx) where _st_covers(ST_GeomFromText('POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))', 4326, 'axis-order=long-lat'), g);
|
select id, st_astext(g) from geo_t1 FORCE INDEX(g_idx) where _st_covers(ST_GeomFromText('POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))', 4326, 'axis-order=long-lat'), g);
|
||||||
|
|
||||||
drop table geo_t1;
|
drop table geo_t1;
|
||||||
|
|
||||||
|
--echo bugfix: 53822176
|
||||||
|
--disable_warnings
|
||||||
|
drop table if exists spatial_point_in_line;
|
||||||
|
--enable_warnings
|
||||||
|
create table spatial_point_in_line (
|
||||||
|
`id` int unsigned not null auto_increment primary key ,
|
||||||
|
`min` int unsigned not null default 0,
|
||||||
|
`max` int unsigned not null default 0,
|
||||||
|
`line_geo` geometry not null srid 0,
|
||||||
|
SPATIAL INDEX index_spatial_line_geo(`line_geo`)
|
||||||
|
);
|
||||||
|
insert into spatial_point_in_line (min, max, line_geo) values
|
||||||
|
(80, 90, LineString(Point(min, 0), Point(max, 0))),
|
||||||
|
(80, 100, LineString(Point(min, 0), Point(max, 0))),
|
||||||
|
(90, 100, LineString(Point(min, 0), Point(max, 0))),
|
||||||
|
(100, 110, LineString(Point(min, 0), Point(max, 0))),
|
||||||
|
(100, 120, LineString(Point(min, 0), Point(max, 0)));
|
||||||
|
|
||||||
|
select id, min, max, st_astext(line_geo) from spatial_point_in_line where ST_Contains(line_geo, LineString(Point(80, 0), Point(91, 0)));
|
||||||
|
explain select id, min, max, st_astext(line_geo) from spatial_point_in_line where ST_Contains(line_geo, LineString(Point(80, 0), Point(91, 0)));
|
||||||
|
select id, min, max, st_astext(line_geo) from spatial_point_in_line ignore index(geom_idx_1) where ST_Contains(line_geo, LineString(Point(80, 0), Point(91, 0)));
|
||||||
|
|||||||
@ -6,14 +6,14 @@
|
|||||||
--source mysql_test/test_suite/geometry/t/import_default_srs_data_mysql.inc
|
--source mysql_test/test_suite/geometry/t/import_default_srs_data_mysql.inc
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
DROP TABLE IF EXISTS t1;
|
DROP TABLE IF EXISTS partition_t1;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
create table t1(c1 int primary key, g geometry not null srid 0) partition by hash(c1) partitions 2;
|
create table partition_t1(c1 int primary key, g geometry not null srid 0) partition by hash(c1) partitions 2;
|
||||||
create spatial index idx on t1 (g) local;
|
create spatial index idx on partition_t1 (g) local;
|
||||||
insert into t1 (c1, g) values (0, st_geomfromtext('point(1 1)'));
|
insert into partition_t1 (c1, g) values (0, st_geomfromtext('point(1 1)'));
|
||||||
explain select /*+index(t1 idx)*/ st_astext(g) from t1 where st_intersects(g, st_geomfromtext('point(1 1)'));
|
explain select /*+index(partition_t1 idx)*/ st_astext(g) from partition_t1 where st_intersects(g, st_geomfromtext('point(1 1)'));
|
||||||
select /*+index(t1 idx)*/ st_astext(g) from t1 where st_intersects(g, st_geomfromtext('point(1 1)'));
|
select /*+index(partition_t1 idx)*/ st_astext(g) from partition_t1 where st_intersects(g, st_geomfromtext('point(1 1)'));
|
||||||
drop table t1;
|
drop table partition_t1;
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
DROP TABLE IF EXISTS t1;
|
DROP TABLE IF EXISTS t1;
|
||||||
|
|||||||
Reference in New Issue
Block a user