This is a discussion on Sort multiple fields consumes more CPU time and RAM within the MySQL Database forums, part of the Database Forums category; Hello everybody, I have a little problem with some queries using multiple ORDER BY ... ASC/DESC and they are really ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello everybody,
I have a little problem with some queries using multiple ORDER BY ... ASC/DESC and they are really slow. I was thinking to do some mathematical calculation in order to calculate the best ratio that will keep the order of all my fields as if it was done with an usual multiple ORDER BY... sql query. The idea is to calculate that ratio in the SELECT query; and sort ONLY ONCE the result of my query. The ratio can be calculated from the LENGTH() of some VARCHAR fields, and some other INT fiealds Can somebody help with some maths please :) |
![]() |
| Thread Tools | |
| Display Modes | |
|
|