What's the most efficient way to select the last n rows in a table without changing the table's structure?

后端 未结 8 1855
天命终不由人
天命终不由人 2020-12-10 02:25

What\'s the most efficient way to select the last n number of rows in a table using mySQL? The table contains millions of rows, and at any given time I don\'t know how large

8条回答
  •  借酒劲吻你
    2020-12-10 02:47

    You would probably also want to add a descending index (or whatever they're called in mysql) as well to make the select fast if it's something you're going to do often.

提交回复
热议问题