We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27376
    • 576 Posts
    Is there any reason why we use numerical values in some ’ORDER BY’ clauses? Is it faster than using the column name?

    For instance, using "[tt]ORDER BY category, name[/tt]" instead of "[tt]ORDER BY 5, 1[/tt]".

    I understand that it adds flexibility for changing of column names, but the tradeoff is ease of readibility in the case of the query in [tt]manager/actions/resources.static.php[/tt] on line 14. I see a number of ways that this query could be optimized.

    Thought I’d get the opinion of some of the MODx gurus, I came on to the team late in the game and don’t want to be changing patterns smiley Let me know what you all think.
      • 28215
      • 4,149 Posts
      My bet is that the numbers in ORDER BY clauses are legacy.

      I’d stick with the column names.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 27376
        • 576 Posts
        Cool! I’ll go ahead and switch the code in the file, It’s sure to give a little speed boost smiley