List:Internals« Previous MessageNext Message »
From:PaginaDeSpud Date:November 9 2005 10:12am
Subject:ALTER TABLE `mytable` ORDER BY `key_field` DESC
View as plain text  
Hi,
ALTER TABLE `mytable` ORDER BY `key_field` DESC

Why if i set the default order by of my table, being key_field  PRIMARY KEY
AUTOINCREMENT, it only makes an initial order by but all rows inserted later
are not ordered?

Is it too much difficult to add these new rows in this order?

My site makes thousands of querys asking for the last 15 rows inserted on
this table, ordered by primary key desc, over 200.000 rows and it takes 0.68
seconds on a dual XEON (4 processors), but it takes 0.08 seconds if no order
is asked. It would be beatiful if you consider this option on future
versions of mysql.

Thanks.
Ivan.

Thread
ALTER TABLE `mytable` ORDER BY `key_field` DESCPaginaDeSpud9 Nov
  • Re: ALTER TABLE `mytable` ORDER BY `key_field` DESCIngo Strüwing9 Nov
  • Re: ALTER TABLE `mytable` ORDER BY `key_field` DESCPaginaDeSpud3 Dec
    • Re: ALTER TABLE `mytable` ORDER BY `key_field` DESCIngo Strüwing5 Dec