From: spameden Date: October 16 2012 10:30pm Subject: Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order List-Archive: http://lists.mysql.com/mysql/228421 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff243bdfefcab04cc34b14d --e89a8ff243bdfefcab04cc34b14d Content-Type: text/plain; charset=ISO-8859-1 That's exactly what I thought when reading Michael's email, but tried anyways, thanks for clarification :) 2012/10/16 > >>>> 2012/10/16 12:57 -0400, Michael Dykman >>>> > your now() statement is getting executed for every row on the select. try > ptting the phrase up front > as in: > set @ut= unix_timestamp(now()) > and then use that in your statement. > <<<<<<<< > Quote: > > Functions that return the current date or time each are evaluated only > once per query at the start of query execution. This means that multiple > references to a function such as > NOW() > within a single query always produce the same result. (For our purposes, a > single query also includes a call to a stored program (stored routine, > trigger, or event) and all subprograms called by that program.) This > principle also applies to > CURDATE(), > CURTIME(), > UTC_DATE(), > UTC_TIME(), > unctio > ns.html#function_utc-timestamp>UTC_TIMESTAMP(), and to any of their > synonyms. > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql > > --e89a8ff243bdfefcab04cc34b14d--