How to further optimize this MySQL table for a single Query

前端 未结 2 858
滥情空心
滥情空心 2021-01-05 21:01

I have a InnoDB MySql Geo ID table that has ~ 1 million rows. The table structure is this:

CREATE TABLE `geoid` (
   `start_ip` int(11) NOT NULL,
   `end_ip`         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-05 21:17

    Try adding an index on end_ip. This should make the query about twice as fast in some cases.

    For much better perfomance you need to use a SPATIAL index, as explained in this article.

提交回复
热议问题