CREATE TABLE t1 (
g GEOMETRY NOT NULL
) ENGINE=InnoDB;
ALTER TABLE t1 ADD SPATIAL(g); SET @g1 = ST_GeomFromText('POINT(10 10)'); SET @g2 = ST_GeomFromText('POLYGON((5 5, 20 5, 20 21, 5 21, 5 5))'); SET @g3 = ST_GeomFromText('POLYGON((1.79769e+308 1.79769e+308, 20 5, -1.79769e+308 -1.79769e+308, 1.79769e+308 1.79769e+308))');
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRContains(g, @g1);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL g NULL NULL NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g1);
ST_AsText(g)
INSERT INTO t1 VALUES(@g1);
INSERT INTO t1 VALUES(@g2);
INSERT INTO t1 VALUES(@g3);
SELECT ST_AsText(g) FROM t1;
ST_AsText(g)
POINT(1010)
POLYGON((55,205,2021,521,55))
POLYGON((1.79769e308 1.79769e308,205,-1.79769e308 -1.79769e308,1.79769e308 1.79769e308))
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRContains(g, @g1);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range g g 34 NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g1);
ST_AsText(g)
POINT(1010)
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRDisjoint(g, @g1);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range g g 34 NULL 2 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g1);
ST_AsText(g)
POINT(1010)
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBREquals(g, @g1);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range g g 34 NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g1);
ST_AsText(g)
POINT(1010)
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRIntersects(g, @g1);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range g g 34 NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g1);
ST_AsText(g)
POINT(1010)
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g1);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range g g 34 NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g1);
ST_AsText(g)
POINT(1010)
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRContains(g, @g2);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range g g 34 NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g2);
ST_AsText(g)
POINT(1010)
POLYGON((55,205,2021,521,55))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRDisjoint(g, @g2);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range g g 34 NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g2);
ST_AsText(g)
POINT(1010)
POLYGON((55,205,2021,521,55))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBREquals(g, @g2);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range g g 34 NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g2);
ST_AsText(g)
POINT(1010)
POLYGON((55,205,2021,521,55))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRIntersects(g, @g2);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range g g 34 NULL 2 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g2);
ST_AsText(g)
POINT(1010)
POLYGON((55,205,2021,521,55))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g2);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range g g 34 NULL 2 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g2);
ST_AsText(g)
POINT(1010)
POLYGON((55,205,2021,521,55))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRContains(g, @g3);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL g NULL NULL NULL 3 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g3);
ST_AsText(g)
POINT(1010)
POLYGON((55,205,2021,521,55))
POLYGON((1.79769e308 1.79769e308,205,-1.79769e308 -1.79769e308,1.79769e308 1.79769e308))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRDisjoint(g, @g3);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL g NULL NULL NULL 3 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g3);
ST_AsText(g)
POINT(1010)
POLYGON((55,205,2021,521,55))
POLYGON((1.79769e308 1.79769e308,205,-1.79769e308 -1.79769e308,1.79769e308 1.79769e308))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBREquals(g, @g3);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL g NULL NULL NULL 3 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g3);
ST_AsText(g)
POINT(1010)
POLYGON((55,205,2021,521,55))
POLYGON((1.79769e308 1.79769e308,205,-1.79769e308 -1.79769e308,1.79769e308 1.79769e308))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRIntersects(g, @g3);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL g NULL NULL NULL 3 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g3);
ST_AsText(g)
POINT(1010)
POLYGON((55,205,2021,521,55))
POLYGON((1.79769e308 1.79769e308,205,-1.79769e308 -1.79769e308,1.79769e308 1.79769e308))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g3);
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL g NULL NULL NULL 3 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g3);
ST_AsText(g)
POINT(1010)
POLYGON((55,205,2021,521,55))
POLYGON((1.79769e308 1.79769e308,205,-1.79769e308 -1.79769e308,1.79769e308 1.79769e308))
DROP TABLE t1;
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.8 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.