How to further optimize this MySQL table for a single Query

前端 未结 2 839
滥情空心
滥情空心 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.

    0 讨论(0)
  • 2021-01-05 21:30

    Try to create index on all fields included in query. on this particular case create one index on two fields (start_ip and end_ip)

    0 讨论(0)
提交回复
热议问题