关于timestamp的比较问题
简单来说,就是在表中对timestamp数据进行比较时发现select timestamp1 from table1 where timestamp1 < current_timestamp的数据库查询耗时远高于
select unix_timestamp(timestamp1) from table1 where unix_timestamp(timestamp1) < unix_timestamp(current_timestamp)
造成这个问题的原因是因为timestamp在mysql中的实际存储格式?
还是其他原因啊?
是不是应该在比较timestamp前始终使用unix_timestamp将其进行转换?
页:
[1]