MySQL Forums
Forum List  »  Newbie

Re: Sorting of data before query improves efficiency?
Posted by: Peter Brawley
Date: June 08, 2016 11:53PM

> the whole block gets appended below the table.

New rows are added wherever the engine wants to put them. A fundamental rule of relational databases, the ISO standard, is that physical row order has no effects, so queries without Order By clauses return results in unpredictable order.

Against that ISO standard, MySQL implements Alter Table ...Order By..., but its effects are undone by the next PK update, insert or delete, ie it's useless in tables where data may change and is not reliable even in static tables.

Use Order By clauses in your queries to order row display.

Options: ReplyQuote


Subject
Written By
Posted
Re: Sorting of data before query improves efficiency?
June 08, 2016 11:53PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.