Should I join all of my polygons to make a single polygon for point-in-polygon search? I have a set of of polygons. Sometimes they are completely disconnected (like separate patches). Other times, two sides of two polygons may touch each other (when the polygons are adjacent like on a chess board). The polygons never cross each other. In other words, their intersection is always empty.

I need to check if a point is contained in any one of those polygons. Is there a way I can build a single geometry using these polygons and check if the point is in it?

Currently I'm building a long WHERE close with OR conditions and do something like the below:

st_contains(st_GeomFromText('POLYGON(("+polygon+"))'), st_GeomFromText(CONCAT('POINT()')))
How about ST_Contains() or ST_Within()?

https://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html

Perhaps you need AND ST_Distance(...) &gt; 0?

More likely, you want AND NOT ST_Touches(...).