We are using AWS Aurora/MySQL, engine version 5.7.mysql_aurora.2.09.0
and we have a spatial index on a table with ~10,000,000 rows:
CREATE TABLE `foo` (
...
`lat` decimal(10,6) DEFAULT NULL,
`lng` decimal(10,6) DEFAULT NULL,
...
`geo_polyline` linestring DEFAULT NULL,
...
`geo_location` point GENERATED ALWAYS AS (point(`lng`,`lat`)) STORED NOT NULL,
...
SPATIAL KEY `geo_location_index` (`geo_location`),
...
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
When we do a query like this:
SELECT COUNT(*) from `foo`
where
st_intersects(st_geomfromtext('POLYGON ((16.2 48.1, 16.4 48.1, 16.4 48.2, 16.2 48.2, 16.2 48.1))'), geo_polyline)
and
st_contains(st_geomfromtext('POLYGON ((16.2 48.1, 16.4 48.1, 16.4 48.2, 16.2 48.2, 16.2 48.1))'), geo_location);
the server crashes. This is repeatable: it happens every time.
Has anyone else experienced anything like this and does anyone have any ideas for workarounds?