Slow INSERT into InnoDB table with random PRIMARY KEY column's value

前端 未结 1 444
我在风中等你
我在风中等你 2020-12-17 03:42

For my website I use the PHP API for Flickr ( http://www.flickr.com/services/api/ ). This API provides several useful methods to get photos around particular GPS positions.<

相关标签:
1条回答
  • 2020-12-17 04:31

    InnoDB does not support hash keys, only Btree.

    MyISAM is infamous for being unreliable.
    I think your problem is that you use the MD5 value for the primary key.

    The primary key is included in every secondary key. And the PK is forced to be a unique key.

    Set an integer autoincrement primary key and set your MD5 value as a normal index.
    It does not even need to be unique, because that's a huge part of what's slowing you down.

    After this your inserts should run much faster.

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