 <p>I assume the pairs have also a corresponding value by which to group them into polygons. If you gave each group two pairs of coordinates that escribed a "rectangle" around the polygon, you could significantly limit the search with a simple SQL comparison. </p> <p>The latter computation of whether or not the point is included in the actual polygon seems not practically possible with just SQL.</p> <p>That's one suggestion.</p>