Best practice question for MySQL: order by id or date?

前端 未结 3 977
北恋
北恋 2020-12-29 12:23

This is kind of a noobish question, but it\'s one that I\'ve never been given a straight answer on.

Suppose I have a DB table with the following fields and

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-29 12:33

    Maybe is faster by id, but safer by datetime; use the latter if have performance issues add an index.

提交回复
热议问题