Answer the question
In order to leave comments, you need to log in
How to optimize query with ST_CROSSES?
Mariadb 10.4.8
I am looking for a match with custom points, two points are given, I am looking for routes from the database (line field), whether this route contains this point. The search is performed by building a buffer around a point and the presence of an intersection of a line and a polygon.
Request:
SELECT * FROM search WHERE ST_CROSSES(line,ST_BUFFER(ST_GEOMFROMTEXT('POINT(55.7562903 37.6170739)'),0.2)) and ST_CROSSES(line,ST_BUFFER(ST_GEOMFROMTEXT('POINT(59.93427559999999 30.335136)'),0.2)) LIMIT 0,1
Answer the question
In order to leave comments, you need to log in
Will it not be faster? :
SELECT * FROM search WHERE ST_CROSSES(line,ST_BUFFER(ST_GEOMFROMTEXT('POINT(55.7562903 37.6170739)'),0.2)) and ST_CROSSES(line,ST_BUFFER(ST_GEOMFROMTEXT('POINT(59.93427559999999 30.335136)'),0.2)) FETCH FIRST 1 ROWS ONLY
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question