It looks like you are ordering by a string literal. What's up with the single quotes around 'myfield'
? With a string literal, the same exact value is going to be assigned to every row that is returned. And MySQL can return rows in any order it chooses. There isn't any order that would violate the ORDER BY 'string literal'. I wouldn't be surprised if the optimizer just discards a meaningless ORDER BY clause.
In MySQL, identifiers can be escaped by enclosing them in backticks. On my keyboards, that's the ` ~ key on the upper left, just left of the 1 ! key.
Single quotes enclose a string literal.
(... bypassing a discussion of double quotes and ANSI_QUOTES in sql_mode ...)
What does this query return?
SELECT 'myfield' FROM mytable LIMIT 50 ;
On my system, I get 50 copies of the same string. If I enclose the table name in single quotes, I get a syntax error.
The string literal works exactly the same way in the ORDER BY clause... the same string value appears on every row.
The difference in ordering you observe is likely due to a different access plan. The retrieval of one column may be using an index, the retrieval of all columns is probably a full scan of the table.
If your query isn't using single quotes, then please feel free to post the exact query that you are executing.