I have two tables: one with points, the other with polys.
CREATE TABLE `points` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`point` point NOT NULL,
PR
I have used successfully similar queries, with only one difference in data model: a spatial key on the points database. In my case:
CREATE TABLE geopoints (
pid int(11) NOT NULL AUTO_INCREMENT,
description varchar(255) NOT NULL DEFAULT '',
geopoint point NOT NULL,
PRIMARY KEY (pid),
SPATIAL KEY geopoint (geopoint)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
And everything went well in queries like this:
SELECT pt.pid, x(geopoint), Y(geopoint), pl.pid, AsText(geopolygon)
FROM geopoints pt INNER JOIN geopolygons pl ON MBRCONTAINS(geopolygon, geopoint)
WHERE pt.pid IN (1,2,4,5) AND pl.pid BETWEEN 1 AND 5;
my two cents,