Return-Path: <root@fatcity.com>
Received: from ensim.rackshack.net (root@localhost)
 by orafaq.net (8.11.6/8.11.6) with ESMTP id h45JcOr21615
 for <oracle-l@orafaq.net>; Mon, 5 May 2003 14:38:24 -0500
X-ClientAddr: 209.68.248.164
Received: from newsfeed.cts.com (newsfeed.cts.com [209.68.248.164])
 by ensim.rackshack.net (8.11.6/8.11.6) with ESMTP id h45JcOA21610
 for <oracle-l@orafaq.net>; Mon, 5 May 2003 14:38:24 -0500
Received: from fatcity.com (uucp@localhost)
 by newsfeed.cts.com (8.9.3/8.9.3) with UUCP id KAA77124;
 Mon, 5 May 2003 10:13:27 -0700 (PDT)
Received: by fatcity.com (26-Feb-2001/v1.0g-b72/bab) via UUCP id 0058FC02; Mon, 05 May 2003 09:31:55 -0800
Message-ID: <F001.0058FC02.20030505093155@fatcity.com>
Date: Mon, 05 May 2003 09:31:55 -0800
To: Multiple recipients of list ORACLE-L <ORACLE-L@fatcity.com>
X-Comment: Oracle RDBMS Community Forum
X-Sender: Gurelei <gurelei@yahoo.com>
Sender: root@fatcity.com
Reply-To: ORACLE-L@fatcity.com
Errors-To: ML-ERRORS@fatcity.com
From: Gurelei <gurelei@yahoo.com>
Subject: need help with an update
Organization: Fat City Network Services, San Diego, California
X-ListServer: v1.0g, build 72; ListGuru (c) 1996-2001 Bruce A. Bergman
Precedence: bulk
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi all:

May be someone can help me to tune this update ...

update A1 a
set a.empl_hrchy_id =
(select maxid from B1 b
 where a.usr_id = b.usr_id)
where exists
(select 'x' from B1 where usr_id = a.usr_id)

Table A1 has several million rows (5 to 6), table
B1 has no more than 5 thousand rows.. A1 is indexed 
on the fields, usr_id, usr_id/empl_hrchy_id
and empl_hrcy_id/usr_id. B1 has no indices. The
explain plan shows a full table scan against the A1
table, which is something I'd like to avoid. Is there
a way to make Oracle use an index instead (without
hints)?

thanks

Gene


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Gurelei
  INET: gurelei@yahoo.com

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@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).

