【发布时间】:2021-07-04 14:10:37
【问题描述】:
升级到 mariadb 10.5.11 后,我遇到了一个奇怪的索引问题。
具有两个列的简单表 Type(varchar) 和 Point(point)
Type(Tindex) 上的索引和Point(Pindex) 上的空间索引
现在是一个类似的查询
SELECT X(Point) as x,Y(Point) as y,hotels.Type FROM hotels WHERE (Type in ("acco")) AND MBRContains( GeomFromText( 'LINESTRING(4.922 52.909,5.625 52.483)' ), hotels.Point)
;
结果
查询错误 (1207):在 READ UNCOMMITTED 事务期间无法获取更新锁
同时
SELECT X(Point) as x,Y(Point) as y,hotels.Type FROM hotels USE INDEX (Pindex) WHERE (Type in ("acco")) AND MBRContains( GeomFromText( 'LINESTRING(4.922 52.909,5.625 52.483)' ), hotels.Point)
;
和
SELECT X(Point) as x,Y(Point) as y,hotels.Type FROM hotels USE INDEX (Tindex) WHERE (Type in ("acco")) AND MBRContains( GeomFromText( 'LINESTRING(4.922 52.909,5.625 52.483)' ), hotels.Point)
;
工作正常。正如 mariadb 10.5.10 所做的那样
|编号 |选择类型 |表|类型 |可能的键 |关键 | key_len |参考 |行 |额外 |
| 1 |简单 |酒店 |范围|过滤器 |类型,Pindex | Pindex|类型 | 34|302 |空 | 340 (4%) |使用哪里;使用 rowid 过滤器 |
【问题讨论】:
标签: mariadb mariadb-10.5