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: Wendry <wendry_yang_at_indo.net.id>
Date: Sun, 18 Jan 2004 06:34:26 -0800
Message-ID: <F001.005DD2B3.20040118063426@fatcity.com>

Thanks for the reply Tim,

I will try to look at the index and bad blocks at the datafile or restart the database again. The type column for QTY_SOLD_SO is number.

Regards,

Wendry.

-----Original Message-----
Sent: Saturday, January 17, 2004 9:15 PM To: 'Wendry'

I would suspect some problems with indexes on the tables.

I would recreate the tables using different names for testing, with the same
data
and see if you get the same problems.

If it is still does not work maybe it is bad blocks on the database or damaged Oracle proccess in which case restart the database. Also try turning on tracing and check the output.

It could also be a bug with the group by function check to see what column
type SO and QTY_SOLD_SO is and check metalink to see if it is a bug with using group by on your version of Oracle with that particular data type.

-----Original Message-----
Sent: Saturday, January 17, 2004 2:59 PM To: LazyDBA.com Discussion

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.



Get today's cartoon: http://www.LazyDBA.com Please don't reply to RTFM questions Oracle documentation is here: http://tahiti.oracle.com To unsubscribe: send a blank email to oracledba-unsubscribe_at_LAZYDBA.com To subscribe: send a blank email to oracledba-subscribe_at_LAZYDBA.com By using this list you agree to these
terms:http://www.lazydba.com/legal.html
-- 
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 Sun Jan 18 2004 - 08:34:26 CST

Original text of this message

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