List:General Discussion« Previous MessageNext Message »
From:Christophe Date:March 20 2014 12:18pm
Subject:Re: Precedence in WHERE clauses.
View as plain text  
Hi Michael,

Le 18/03/2014 20:28, Michael Dykman a écrit :
> 
> Also, as you currently have it, the expression DATE_SUB(NOW(),
> INTERVAL 24 is going to be executed once for every single candidate
> row.  I would suggest you temporarily memoize that like so:
> 
> select into DATE_SUB(NOW(), INTERVAL 24 HOUR) INTO @yesterday  ;
> 
> SELECT * FROM Status WHERE DWProcessed = 0 AND PreviousStatus NOT IN
> ('PENDING', 'ACCEPTED') AND SubscribeDate < @yesterday);
> 

Indeed ! it can be a significant performance improvement ;).
Thanks for this .

Regards,
Christophe.
Thread
Precedence in WHERE clauses.Christophe18 Mar
  • Re: Precedence in WHERE clauses.Michael Dykman18 Mar
    • Re: Precedence in WHERE clauses.Christophe20 Mar
      • Re: Precedence in WHERE clauses.Roy Lyseng20 Mar
  • Re: Precedence in WHERE clauses.Glyn Astill19 Mar
  • Re: Precedence in WHERE clauses.Morgan Tocker19 Mar
    • Re: Precedence in WHERE clauses.Reindl Harald19 Mar
      • Re: Precedence in WHERE clauses.Morgan Tocker19 Mar
        • Re: Precedence in WHERE clauses.Reindl Harald19 Mar
          • Re: Precedence in WHERE clauses.Morgan Tocker19 Mar
            • Re: Precedence in WHERE clauses.Christophe20 Mar
              • Re: Precedence in WHERE clauses.Christophe23 Mar
                • Re: Precedence in WHERE clauses.shawn l.green25 Mar
    • Re: Precedence in WHERE clauses.Mogens Melander19 Mar
      • Re: Precedence in WHERE clauses.shawn l.green20 Mar