Which DB design is faster: a unique index and INSERT IGNORE, or using SELECT to find existing records?

后端 未结 6 2000
长情又很酷
长情又很酷 2020-12-21 12:03

I have a table with just one column: userid.

When a user accesses a certain page, his userid is being inserted to the table. Userids are unique, so there shouldn\'t

6条回答
  •  半阙折子戏
    2020-12-21 12:29

    SELECT is faster... but you'd prefer SELECT check not because of this, but to escape from rasing an error..

提交回复
热议问题