Hi,

On Mon, Apr 14, 2008 at 1:54 PM, Jamie Madill <[EMAIL PROTECTED]> wrote:
> Hello,
>
>  Basically I want to know if this is a good query for indexing.
>
>  I have the following query:
>
>  select
>   count(1) as count
>  from
>   session
>  where
>   last >= DATE_SUB(NOW(), INTERVAL :from SECOND)
>
>  Is it safe to assume that the expression calling the function DATE_SUB
>  is evaluated just once to a fixed date?

Yes, that's correct.

-- 

Baron Schwartz, Senior Consultant, Percona Inc.
Tel: +1 888 401 3401 ext 507
24/7 Emergency Line +1 888 401 3401 ext 911
Our Services: http://www.percona.com/services.html
Our Blog: http://www.mysqlperformanceblog.com/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to