Re: "between" vs. ">= and <="

From: hpuxrac <johnbhurley_at_sbcglobal.net>
Date: Sat, 22 Nov 2008 05:56:04 -0800 (PST)
Message-ID: <27115623-b527-4a27-a8de-21838bd557d9@n10g2000yqm.googlegroups.com>


On Nov 14, 12:40 pm, "Jonathan Lewis" <jonat..._at_jlcomp.demon.co.uk> wrote:

snip

> > SQL> set autotrace traceonly
> > SQL> select *
> >  2  from t1
> >  3  where ts between systimestamp + 10000 and systimestamp + 10001
> >  4  /
>
> > Predicate Information (identified by operation
> > id):
> > ---------------------------------------------------
>
> >   1 - filter(SYSTIMESTAMP(6)+10000<=SYSTIMESTAMP(6)+10001)
> >   2 - filter("TS">=SYSTIMESTAMP(6)+10000 AND
> >              "TS"<=SYSTIMESTAMP(6)+10001)
>
> There is no difference - check the predicates section of
> the plan.  "Between" is transformed to ">= and <="

Even among the Oracle pro's I am always surprised how many people haven't read Jonathans book on the optimizer. I hereby resolve to read it again by Jan 1st!

Wondering what progress and/or current plans Jonathan has for ( what was at one time ) a planned book 2 and book 3 in the series? Received on Sat Nov 22 2008 - 07:56:04 CST

Original text of this message