Skip to content

Instantly share code, notes, and snippets.

@ponkotuy
Created November 17, 2019 12:10
Show Gist options
  • Save ponkotuy/56f06daf3fcd51951fad4d831cf8b2ba to your computer and use it in GitHub Desktop.
Save ponkotuy/56f06daf3fcd51951fad4d831cf8b2ba to your computer and use it in GitHub Desktop.
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