Category Archives: SQL

SQL query speed

Take a look at these 2 queries Query 1: SELECT if(TIMESTAMPDIFF(SECOND,dtime,NOW()) > 90,0,counter) AS counter, UNIX_TIMESTAMP(dtime) AS dtime FROM ifInOctets_1 WHERE id = 100 ORDER BY dtime DESC LIMIT 1 Query 2: SELECT if(TIMESTAMPDIFF(SECOND,dtime,NOW()) > 90,0,counter) AS counter, UNIX_TIMESTAMP(dtime) AS … Continue reading

Posted in SQL | Comments Off on SQL query speed