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: Strange Query Result,... urgent please

Re: Strange Query Result,... urgent please

From: Tanel Poder <tanel.poder.003_at_mail.ee>
Date: Sat, 17 Jan 2004 06:39:25 -0800
Message-ID: <F001.005DD203.20040117063925@fatcity.com>


Hi!

Use SET TRANSACTION READ ONLY before your run the queries and run them again (without any commits or rollbacks in the middle). That way you can be sure that any hidden changes to data won't be reflected.

Tanel.

>
>
> Dear All,
>
> I need help on the following query, the following has been simplified to
> show you the exact problem. Due to this error, the sql query is giving
> unstable result which affects on production reporting in my company. I
> wonder what's the real problem?
>
> SQL> SELECT COUNT(1) FROM
> 2 (SELECT SO,SUM(QTY_SOLD_SO) AS QTY_SOLD
> 3 FROM IVC_DET IVC
> 4 GROUP BY SO
> 5 );
>
> COUNT(1)
> ----------
> 44087
>
> SQL> l
> 1 SELECT COUNT(1) FROM
> 2 (SELECT SO,SUM(QTY_SOLD_SO) AS QTY_SOLD
> 3 FROM IVC_DET IVC
> 4 GROUP BY SO
> 5* )
> SQL> /
>
> COUNT(1)
> ----------
> 44085
>
> >From the above query nobody has changed any record in my production
> database but the result is unstable. After I remove group function it
> becomes stable as below.
>
> SQL> SELECT COUNT(1) FROM
> 2 (SELECT SO
> 3 FROM IVC_DET IVC
> 4 GROUP BY SO
> 5 );
>
> COUNT(1)
> ----------
> 50770
>
> SQL> /
>
> COUNT(1)
> ----------
> 50770
>
> Now my opinion is the sort process has been ruined. I checked alert.log
> but I found no entries regarding this problem. So I check the sort ratio
> through performance manager and it shows almost 100% hit ratio. Well,
> just in case, next I checked on my Temporary tablespace and it still has
> a lot of room to do sorts. Anyone has experience this before? Please
> give me some light, ideas or suggestion to correct this, since I have a
> lot of very complex queries. I feel like a bomb is ticking for other
> complex queries. Thank you all in advance.
>
> Regards,
>
> Wendry.
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Wendry
> INET: wendry_yang_at_indo.net.id
>
> 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).
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Tanel Poder
  INET: tanel.poder.003_at_mail.ee

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 Sat Jan 17 2004 - 08:39:25 CST

Original text of this message

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