MySQL: Optimal index for between queries

后端 未结 5 849
南笙
南笙 2021-02-19 13:26

I have a table with the following structure:

CREATE TABLE `geo_ip` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `start_ip` int(10) unsigned NOT NULL,
  `end_ip         


        
5条回答
  •  清歌不尽
    2021-02-19 14:07

    Best index for BETWEEN queries are B-TREE indices. See MySQL docs on that Topic.

    ALTER TABLE myTable ADD INDEX myIdx USING BTREE (myCol)
    

提交回复
热议问题