Path: text.usenetserver.com!out04a.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!news.mixmin.net!eweka.nl!hq-usenetpeers.eweka.nl!68.142.88.75.MISMATCH!hwmnpeer01.ams!news.highwinds-media.com!feeder1.cambrium.nl!feed.tweaknews.nl!newshub2.home.nl!newshub1.home.nl!home.nl!not-for-mail
From: Frank van Bortel <frank.van.bortel@gmail.com>
Newsgroups: comp.databases.oracle.server
Subject: Re: Question on 8.1.7
Date: Sun, 09 Sep 2007 18:55:33 +0200
Organization: @Home Benelux
Lines: 46
Message-ID: <fc1dc9$dfb$1@news4.zwoll1.ov.home.nl>
References: <1189354836.746350.308770@d55g2000hsg.googlegroups.com>
Reply-To:  frank.van.bortel@gmail.com
NNTP-Posting-Host: cc28855-a.hnglo1.ov.home.nl
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news4.zwoll1.ov.home.nl 1189361870 13803 82.75.92.64 (9 Sep 2007 18:17:50 GMT)
X-Complaints-To: usenet@corp.home.nl
NNTP-Posting-Date: Sun, 9 Sep 2007 18:17:50 +0000 (UTC)
User-Agent: Thunderbird 1.5 (Windows/20051201)
In-Reply-To: <1189354836.746350.308770@d55g2000hsg.googlegroups.com>
X-Enigmail-Version: 0.94.1.2
Xref: usenetserver.com comp.databases.oracle.server:434656
X-Received-Date: Sun, 09 Sep 2007 12:55:46 EDT (text.usenetserver.com)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gokul wrote:
> Hello,
> 
> We hit a strange problem on version 8.1.7.
> 
> select col1,col2,col3 from tab1,view1,tab2.. where col5 >= '08-Sep-07'
> 
> select col1,col2,col3 from tab1,view1,tab2.. where col5 >=
> to_date(to_char(sysdate-1,'YYYYMMDD'),'YYYYMMDD')
> 
> These two queries behave differently. The first one takes less than 2
> secs and the second one takes 15 minutes.
> 
> I dont have more details. Just trying my luck here to check if someone
> has faced such problem in the past.
> 
> Any ideas ?
> 
> PS: '08-Sep-07' and (sysdate - 1) are same.
> 
> Rgds,
> Gokul
> 
What is the data type of col5? Is it varchar2 or date?
(or :shock: something different than that?!?)

Oh, and '08-sep-07'  is *not* the same as (sysdate - 1),
just so you know. Anything between quotes is called string.
A date is not  a string. (but can be presented as a string).

Do you understand why your queries behave differently now?
- --
Regards,
Frank van Bortel

Top-posting is one way to shut me up...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)

iD8DBQFG5CWFLw8L4IAs830RAoESAJ4ygXGLNxyPxtglV67AkG3oN52+AwCeLvln
Q+GYXjIW4TskXvte0y8E2tc=
=Kp59
-----END PGP SIGNATURE-----
