Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Query rewrite help needed

RE: Query rewrite help needed

From: MOORE, Peter Rbh <Peter.MOORE.RBH_at_reading.sema.slb.com>
Date: Mon, 10 Mar 2003 09:20:34 -0800
Message-ID: <F001.00564B7D.20030310092034@fatcity.com>


Jonathan,

I trust you meant to write:

"trunc(d1)=..."

rather than

"trunc(sysdate)..."

:-)

Do I win the $100?

--
Peter Moore
Systems DBA,
Mid-Range Centre of Expertise,
Global Service Delivery,
SchlumbergerSema,
Reading

Phone: 0118 963 6827
Email: pmoore7_at_slb.com



> -----Original Message-----
> From: Jonathan Lewis [mailto:jonathan_at_jlcomp.demon.co.uk]
> Sent: 10 March 2003 15:24
> To: Multiple recipients of list ORACLE-L
> Subject: Re: Query rewrite help needed
>
>
>
> Tim,
>
> Following your trunc() line, have you come
> across this feature of 9.2 (and some earlier
> versions) -
>
> create index t1_i2 on t1(d1);
> analyze table t1 compute statistics;
>
> select * from t1
> where trunc(sysdate) = '01-Dec-2002';
>
> Execution plan:
> -----------------------
> table access (by index rowid) of 'T1'
> index (range scan) of 'T1_I2' (non-unique)
>
> Note the index name, in particular.
>
> It's another little feature that takes away
> some of the hassle of getting the text
> 'just so'.
>
> How does it do it, you ask ? I'll leave it
> open for a while in case anyone wants to
> have some fun guessing.
>
> All correct answers received by 5 pm (GMT)
> tonight will go into a prize draw.
> Note - Answers must be written on the back
> of a USD$100 bill and delivered by hand to
> the author's bank manager be eligible.
>
>
> Regards
>
> Jonathan Lewis
> http://www.jlcomp.demon.co.uk
>
> Now available One-day tutorials:
> Cost Based Optimisation
> Trouble-shooting and Tuning
> Indexing Strategies
>
> (see http://www.jlcomp.demon.co.uk/tutorial.html )
>
> ____UK_______March 19th
> ____UK_______April 8th
> ____UK_______April 22nd
>
> ____USA_(FL)_May 2nd
>
>
> Next dates for the 3-day seminar:
> (see http://www.jlcomp.demon.co.uk/seminar.html )
>
> ____UK_(Manchester)_May
> ____USA_(CA, TX)_August
>
>
> The Co-operative Oracle Users' FAQ
> http://www.jlcomp.demon.co.uk/faq/ind_faq.html
>
>
> ----- Original Message -----
> To: "Multiple recipients of list ORACLE-L" <ORACLE-L_at_fatcity.com>
> Sent: 10 March 2003 13:43
>
>
> > In the same vein, I'd suggest rewriting:
> >
> > and trunc(a.seg_dep_date_time) = :seg_dep_date
> >
> > as:
> >
> > and a.seg_dep_date_time >= :seg_dep_date
> > and a.seg_dep_date_time < :seg_dep_date + 1
> >
>
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Jonathan Lewis
> INET: jonathan_at_jlcomp.demon.co.uk
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
_________________________________________________________ This email is confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of SchlumbergerSema. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. If you have received this email in error please notify the SchlumbergerSema Helpdesk by telephone on +44 (0) 121 627 5600. _________________________________________________________ -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: MOORE, Peter Rbh INET: Peter.MOORE.RBH_at_reading.sema.slb.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Received on Mon Mar 10 2003 - 11:20:34 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US