Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Tunnig Help Please
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
![]() |
![]() |