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

Home -> Community -> Usenet -> c.d.o.tools -> Tunnig Help Please

Tunnig Help Please

From: Mujahid Hamid <mujahid_at_pharmco.demon.co.uk>
Date: 2000/04/08
Message-ID: <955235392.20888.0.nnrp-01.c2de4f17@news.demon.co.uk>#1/1

Hi all,

I have a two tables, table 'Pre_month' for Previous month and table 'Cur_months' for current month, these tables have with over 100,000 rows and I want to find out new inserted and updated records from the 'cur_month' tables

The following query will give me updated and inserted rows but I have to mark the inserted and updated records , which I cannot do from the following query.

Solution 1.

Select * from cur_month
minus
Select * from pre_month

I know this query will do full table scans, but is this query quicker than the following ??.

Solution 2.

select * from cur_month cur
where not exists (select 'x' from pre_month pre where pre.p_key = cur.p_key)

The above query will give me the new inserted records only, and I still don't know the updated or deleted row.

Is there a way where I can get inserted ,updated and deleted record by just using set query (e.g. minus,intersect and union) if I can then will this set query be quicker than exists or not exists using the primary key columns.

Please help me I am really stuck on this problem for days.

Thanks in advance. Received on Sat Apr 08 2000 - 00:00:00 CDT

Original text of this message

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