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: Stubborn Table

RE: Stubborn Table

From: kkennedy <kkennedy_at_firstpoint.com>
Date: Fri, 31 May 2002 13:54:58 -0800
Message-ID: <F001.004718B2.20020531135458@fatcity.com>


Hi Rachel,

Actually, the group by is because I only want one copy of each key. You see the original query: SELECT <<stuff>> FROM MDMA_INPUT_FILE

   WHERE <<unindexed_value>>=1
   ORDER BY record_type, archive_input_file, meter_identifier, units, data_time_stamp; did a full table scan and a gruesome sort taking 45 minutes or more.

By selecting the first two keys in the aforementioned query and building an outer loop and doing SELECT <<stuff>> FROM MDMA_INPUT_FILE

   WHERE <<unindexed_value>>=1

     and record_type=outer_record_type
     and archive_input_file=outer_archive_input_file
   ORDER BY record_type, archive_input_file, meter_identifier, units, data_time_stamp; I was able to force use of the index, avoid writing the sort stuff out to a bandwidth limited device, and cut the run time better than in half.

I'm likely to be punished in this life or the next but I do what I gotta do.

Kevin

-----Original Message-----
Sent: Friday, May 31, 2002 1:07 PM
To: Multiple recipients of list ORACLE-L

your first statement

SELECT Record_Type, Archive_Input_File
FROM MDMA_Input_File
GROUP BY Record_Type, Archive_Input_File

why GROUP BY and not ORDER BY? I mean, what are you grouping?

I *think*, vague recollections, of reading that group by will force a full table scan. would be interesting to see plan if you change group by to order by


Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Rachel Carmichael
  INET: wisernet100_at_yahoo.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
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.com
-- 
Author: kkennedy
  INET: kkennedy_at_firstpoint.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
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 Fri May 31 2002 - 16:54:58 CDT

Original text of this message

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