List:General Discussion« Previous MessageNext Message »
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
View as plain text  
That's exactly what I thought when reading Michael's email, but tried
anyways, thanks for clarification :)

2012/10/16 <hsv@stripped>

> >>>> 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
>
> <file:///C:/Program%20Files/MySQL/MySQL%20Server%205.5/HELP/functions.html#function_now>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
>
> <file:///C:/Program%20Files/MySQL/MySQL%20Server%205.5/HELP/functions.html#function_curdate>CURDATE(),
>
> <file:///C:/Program%20Files/MySQL/MySQL%20Server%205.5/HELP/functions.html#function_curtime>CURTIME(),
>
> <file:///C:/Program%20Files/MySQL/MySQL%20Server%205.5/HELP/functions.html#function_utc-date>UTC_DATE(),
>
> <file:///C:/Program%20Files/MySQL/MySQL%20Server%205.5/HELP/functions.html#function_utc-time>UTC_TIME(),
> <file:///C:/Program%20Files/MySQL/MySQL%20Server%205.5/HELP/f!
>  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
>
>

Thread
mysql logs query with indexes used to the slow-log and not logging ifthere is index in reverse orderspameden15 Oct
  • Re: mysql logs query with indexes used to the slow-log and notlogging if there is index in reverse orderspameden15 Oct
  • RE: mysql logs query with indexes used to the slow-log and notlogging if there is index in reverse orderRick James15 Oct
    • Re: mysql logs query with indexes used to the slow-log and notlogging if there is index in reverse orderspameden15 Oct
      • Re: mysql logs query with indexes used to the slow-log and notlogging if there is index in reverse orderspameden15 Oct
        • RE: mysql logs query with indexes used to the slow-log and notlogging if there is index in reverse orderRick James15 Oct
          • Re: mysql logs query with indexes used to the slow-log and notlogging if there is index in reverse orderspameden15 Oct
            • Re: mysql logs query with indexes used to the slow-log and not loggingif there is index in reverse orderShawn Green16 Oct
              • Re: mysql logs query with indexes used to the slow-log and notlogging if there is index in reverse orderspameden16 Oct
                • Re: mysql logs query with indexes used to the slow-log and notlogging if there is index in reverse orderMichael Dykman16 Oct
                  • Re: mysql logs query with indexes used to the slow-log and notlogging if there is index in reverse orderspameden16 Oct
                  • Re: mysql logs query with indexes used to the slow-log and notlogging if there is index in reverse orderhsv16 Oct
                    • Re: mysql logs query with indexes used to the slow-log and notlogging if there is index in reverse orderspameden16 Oct
      • RE: mysql logs query with indexes used to the slow-log and notlogging if there is index in reverse orderRick James15 Oct