Skip to content

Instantly share code, notes, and snippets.

@ponkotuy

ponkotuy/point.sql

Created Nov 17, 2019
Embed
What would you like to do?
spatial index(geo)とindex(geo) using rtreeの違い
create table point(
id bigint not null auto_increment primary key,
spa geometry not null,
rtr geometry not null,
spatial index(spa),
index(rtr) using rtree
) engine=InnoDB, default charset=utf8mb4;
mysql> show create table point¥G
Create Table: CREATE TABLE `point` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`spa` geometry NOT NULL,
`rtr` geometry NOT NULL,
PRIMARY KEY (`id`),
SPATIAL KEY `spa` (`spa`),
SPATIAL KEY `rtr` (`rtr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment