Slide 5
Slide 5 text
設定
● データセット:OpenStreetMapの日本全体のデータ(Pointレイヤ 3,445,131行)
● ベンチマーク
○ データセットからランダムに取り出した1点を中心とする矩形(ほぼ正方形)での範囲検索
● テーブル定義(一部抜粋)
> show create table osm_points\G
*************************** 1. row ***************************
Table: osm_points
Create Table: CREATE TABLE `osm_points` (
`id` bigint NOT NULL AUTO_INCREMENT,
`p4326` point NOT NULL /*!80003 SRID 4326 */,
`lat` double GENERATED ALWAYS AS (st_latitude(`p4326`)) STORED,
`lon` double GENERATED ALWAYS AS (st_longitude(`p4326`)) STORED,
`geohash` varchar(24) GENERATED ALWAYS AS (st_geohash(`lon`,`lat`,24)) STORED,
`p0` point GENERATED ALWAYS AS (st_pointfromgeohash(`geohash`,0)) STORED NOT NULL /*!80003 SRID 0 */,
PRIMARY KEY (`id`),
SPATIAL KEY `r4326` (`p4326`), ← SRID 4326 のSpatial Index
SPATIAL KEY `r0` (`p0`) ← SRID 0 のSpatial Index
KEY `lon_lat` (`lon`,`lat`), ← 緯度経度のIndex
KEY `geohash` (`geohash`,`lon`,`lat`) ← GeohashのIndex(ICPを効かせるためにlon, latも含めた複合キー)
) ENGINE=InnoDB AUTO_INCREMENT=3473356 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
1 row in set (0.00 sec)