| 1 |
#******************************************************** |
| 2 |
# Bug 17057168 - LARGE PERFORMANCE REGRESSION FOR INNODB |
| 3 |
# GEOMETRY/SPATIAL INDEX LOOKUP |
| 4 |
#******************************************************** |
| 5 |
--source include/have_geometry.inc |
| 6 |
--source include/not_embedded.inc |
| 7 |
--source include/no_valgrind_without_big.inc |
| 8 |
--source include/have_innodb.inc |
| 9 |
|
| 10 |
CREATE DATABASE geotest; |
| 11 |
use geotest; |
| 12 |
CREATE TABLE tmp (id int unsigned NOT NULL PRIMARY KEY); |
| 13 |
INSERT INTO tmp VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9); |
| 14 |
INSERT INTO tmp SELECT 10+id FROM tmp; |
| 15 |
INSERT INTO tmp SELECT 20+id FROM tmp; |
| 16 |
INSERT INTO tmp SELECT 40+id FROM tmp; |
| 17 |
INSERT INTO tmp SELECT 80+id FROM tmp; |
| 18 |
|
| 19 |
CREATE TABLE t1 (id int unsigned NOT NULL auto_increment PRIMARY KEY, |
| 20 |
location point, INDEX (location)) ENGINE=InnoDB; |
| 21 |
INSERT INTO t1 (location) SELECT POINT(tmp1.id, tmp2.id) FROM tmp tmp1, |
| 22 |
tmp tmp2 ORDER BY tmp1.id, tmp2.id; |
| 23 |
|
| 24 |
#Befor fix, the row number will be the total number of index recs, |
| 25 |
#After fix, the row number will be 1. |
| 26 |
EXPLAIN SELECT id, ST_AsText(location) FROM t1 WHERE location = POINT(1, |
| 27 |
2); |
| 28 |
SELECT id, ST_AsText(location) FROM t1 WHERE location = POINT(1, 2); |
| 29 |
|
| 30 |
DROP TABLE t1; |
| 31 |
DROP TABLE tmp; |
| 32 |
|
| 33 |
DROP DATABASE geotest; |