对于这两个插入查询,我有一个死锁:
insert into PlayerClub (modifiedBy, timeCreated, currentClubId, endingLevelPosition, nextClubId, account_id) values (0, '2014-12-23 15:47:11.596', 180, 4, 181, 561)
insert into PlayerClub (modifiedBy, timeCreated, currentClubId, endingLevelPosition, nextClubId, account_id) values (0, '2014-12-23 15:47:11.611', 180, 4, 181, 563)
Run Code Online (Sandbox Code Playgroud)
这是 InnoDB 状态:
------------------------
LATEST DETECTED DEADLOCK
------------------------
2014-12-23 15:47:11 1f4c
*** (1) TRANSACTION:
TRANSACTION 19896526, ACTIVE 0 sec inserting
mysql tables in use 1, locked 1
LOCK WAIT 5 lock struct(s), heap size 1248, 3 row lock(s), undo log entries 1
MySQL thread id …
Run Code Online (Sandbox Code Playgroud) 您好,我们想在可能很大的集合上索引日期字段。对日期时间字段建立索引是一种好的做法吗?或者我们应该坚持使用日期字段(例如 07/12/2017)索引(这两个选项都可以作为我们日期字段的候选者,当然,如果对性能没有真正的影响,日期时间更合适)