I verified that using “order by” it's really fast so , sometimes is better make a new select than click in a column to get it sorted.
Is that right or am I doing something wrong?
😀 There is nothing wrong. When you use ORDER BY syntax the data is sorted by MySQL in the server side which uses a different mechanism. While when you click on a column header, the sorting is done on client side with a different mechanism.
The code which sorts the grid within SQLyog is doing fine as long as there is a lot of different values in the column you clicked. Otherwise it takes ages for more than 5000 rows. Ever thought of experimenting with different sorting algorithms?