Ad Widget

Collapse

order by null for mysql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #1

    order by null for mysql

    reading http://www.mysqlperformanceblog.com/...porary-tables/ , i noticed the following suggstion :

    As you can see I'm using ORDER BY NULL clause as otherwise MySQL will sort the data after performing group by which is overhead we're not looking to measure. This is actually good trick to use for cases when you do not need GROUP BY results sorted - it can significantly improve performance in some cases.
    zabbix uses quite some 'group by', but does not use 'oder by null' - would it make sense to add this at least to some clauses for performance reasons ?
    Zabbix 3.0 Network Monitoring book
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    I read about this some time ago. I am not happy about making any changes without clear proof of their efficiency. Show me the numbers before and after the change!

    Besides, and this is even more important, MySQL is one of several databases supported supported by ZABBIX. If we supported MySQL only, we would use tons of MySQL specific tricks. Unfortunately (well, fortunately), there are other database engines ZABBIX also uses and MySQL is just one of them. Keeping SQL code clean is very important!
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • richlv
      Senior Member
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Oct 2005
      • 3112

      #3
      Originally posted by Alexei
      I read about this some time ago. I am not happy about making any changes without clear proof of their efficiency. Show me the numbers before and after the change!
      good call. i've limited testing capabilities, so i'll add this to my "maybe try this at some point" list
      Originally posted by Alexei
      Besides, and this is even more important, MySQL is one of several databases supported supported by ZABBIX. If we supported MySQL only, we would use tons of MySQL specific tricks. Unfortunately (well, fortunately), there are other database engines ZABBIX also uses and MySQL is just one of them. Keeping SQL code clean is very important!
      obviously. i wouldn't suggest doing something as a shortcut on a specific db engine - but gaining performance might be a good reason.
      if somebody else feels like testing this... that would be nice.
      Zabbix 3.0 Network Monitoring book

      Comment

      Working...