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

Home -> Community -> Mailing Lists -> Oracle-L -> Strange Query Result,... urgent please

Strange Query Result,... urgent please

From: Wendry <wendry_yang_at_indo.net.id>
Date: Sat, 17 Jan 2004 05:54:25 -0800
Message-ID: <F001.005DD201.20040117055425@fatcity.com>

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).
Received on Sat Jan 17 2004 - 07:54:25 CST

Original text of this message

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