I when I run the first command, mySQL 5.7 only shows a sub-collection of all results. Only when I run the 2nd command I get the correct answer. The problem with the 2nd command: I cannot use the performance boost of the spatial index anymore (checked with the DESCRIBE command).
SELECT id FROM table1 WHERE ST_CONTAINS(@mls, coords);
SELECT id, ST_CONTAINS(@mls,coords) FROM table1 WHERE ST_CONTAINS(@mls,coords)>0;
- coords: Column with x,y POINT spatial data type (with spatial index)
- @mls: a user variable containing a multilinestring, made to a polygon with ST_BUFFER.
Does anyone have a solution for that issue?