Some advise on 'WHERE EXISTS' in OWB.

Hello :-) me again.
I have read a number of topics regarding 'WHERE EXISTS' statment and OWB... got confused so i thought i ask your option.
OWB 10 r2.0.1.31 paris/windows
I need to tune one of my maps - nothing fancy, just a simple delete:
I need to delete values from tables A if they are equeals to the values in table B.
Both of my tables have index on matching fields, however it is non unique index and there is no primary or unique key on the tables that i could use. Both tables are not that big either - table A just under 1mil records and table B about 300K records/
So i created simple map -
Mapped table B to table A, set loading type for table A to delete, set 'Match column when deleting' on the matching column .The map was validated without any problems, the tests on a small data set were fine and bob's my uncle!
However, when i submitted the map with 'real' tables - it took a very long time to run (over an hour). I have other more complex maps (and loads of them) and everything is ticking nicely! so what is the problem with this map?
The code generated by OWB for the delete statment as follows:
DELETE FROM TABLE_A
WHERE TABLE_A.MATCH_COL = TABLE_B_MATCH_COL
and it does take ages to run from TOAD.
So i tried running
DELETE FROM TABLE_A a
WHERE exists (select n.MATCH_COL from TABLE_B n
where a.MATCH_COL = n.MATCH_COL)
it took no time at all.
Now how do i have to construct my map in order for OWB to generate WHERE EXISTS code? Is it better to use lookup or set operator? outer join? which one of them would be WHERE EXISTS?
I have another map set up identically but with larger numbers (over 70 mil records in table A). it has been running sinse yesterday lunch time! So any help/thoughts/suggestions on this matter would be greatly appreciated.
Thank you very much
Kind Regards
Vix
null

Hi Ed.
Thank you very much for your reply - greately appreciated!
I did look into TOAD when trying to 'tune' it before askling for help. The query does gazzilion tables scans (from Long Ops in TOAD), the main reason why it takes forever is 'db file scattered read' (from waits in TOAD). I checked this job first thing this morning and it's still running!
I have been using OWB Paris for the past year or so and i don't know everything there is not know about it. So i don't know how to make it to produce the code with 'WHERE EXISTS' instead of
DELETE FROM "TABLE A"
WHERE ( "TABLE A.MATCH_COL IS NULL AND :b1 IS NULL
OR "TABLE_A.MATCH_COL" = :b2)
I tried putting non-unique index on MATCH_COL of table A, and put unique index on matching column in table B (ensured that there are no duplicates in table B etc) but oracle pessimiser decided not to use it and i don't really know if the hints are working in OWB and how to make them work with OWB code (i pressume just putting them in the code as normal or is there a 'special' way of doing it?!).
I think i am just going to wrap up my statment in a procedure and just execute the procedure within OWB. I wanted to avoid doing so as i like the auditing granularity with OWB (and if it is a procedure it just calls it, executes it and that's it).
Once again thank you very much for all your help with this issue. May be someone else would have some other ideas how to make it work in OWB? If i manage to improve the performance with this particular map - i will post it here, just in case someone else is having the same problem.
Kind Regards
Vix
Message was edited by:
Vix
- I am takling about my second job that is still running - table A has over 70 mil records and table B has over 600K records.

Similar Messages

  • Need some advise

    Hi All,
    I need some advise from you JAVA gurus. Here is the situation:
    Our Java development team developed an application running on Weblogic 8.1 SP3. The application is contained in the ear file....which is perfect. They now wanted to go live in about 3 months from now. We were discussing plans how to it live but running into a major show stopper.
    Our Linux/Unix weblogic support group do not support/ allow running any singleton java processes except whatever is running as weblogic instances.
    Application development has a requirement to run these 5-7 singleton small little java program (currently i do not know exactly what these small little java processes does).
    We have proposed that the application team should own these processes and they have to run it outside of the BEA weblogic servers (i.e these singleton processes are not allowed to run on our common Unix machines running WLS8.1 sp3).
    We have only ONE option:
    1) Run these small little singleton java processes somewhere else that will be owned by application team.
    Questions:
    1) What are the problems that may arise if these singleton processes do not co-exist with where the application server runs (hosting the application ear file)?
    2) Is there any other ways of circumventing this problem (any other ways based on your expertise) ?
    3) Also, iam trying to understand these singleton processes, so what questions should i ask before i have a head to head discussions with the application team ?
    [any watch list??]
    Thanks for all your help.
    Take care.

    duffymo/others,
    I was initially confused with the term "singleton" ...what i meant to say was "stand along java processes". So, there is nothing singleton but this application has few stand alone java processes that the Linux/Unix team do NOT want to run where the weblogic managed instances are running.
    So, say my weblogic servers are running on Host A and Host B each having 3-3 each BEA weblogic managed instances CLUSTERED...then these stand alone java processes IS NOT ALLOWED to run there.
    I hope this time i am much clearer .... :)
    Iam sorry .... i was totally confused with this term called "singleton" as i incorrectly misinterpreted as stand alone java processes ....sorry about that again.

  • Which is fast bulk delete or id's in a table and a where exists ....?

    I have some parent objects and that I use bulk collect with fetch limit and I currently store the primary keys of these parent objects to identify their child objects later by using where exists with a correlated subquery.
    I'm essentially moving objects graphs that span partitions from table to table.
    when I've done my SQL insert into select... I eventually do a delete.
    currently the delete uses the parent objects in this working table to identify the children to delete later.
    Q. What is likely to be faster?
    using a "temporary" table to requery for child objects based on the parents that I have for each batch or
    using returning clause from my insert into select so that I have rowid's or primary keys to work with later on
    when I want to perform my delete operation?
    I essentially have A's that have child B's which in tern have child C's.
    I store a batch of A pk's in a table and use those to identify the B's
    currently I don't store the B's pk but use the A pk's again to identify the B's which in turn are used to identify the C's later.
    I'm thinking if I remember the pk's I'm using at each level I can then use those later when it comes to the deletes.
    typically that's done in a returning clause and using a bulk delete from that collection later.
    thoughts?

    Parallel DML is one option. Another is to ceate a procedure (or package) that does a discreet unit of work (e.g. process parent and its children as a single business transaction). And then write a "+thread manager+" that runs x number copies of these at the same time (via DBMS_JOB for example).
    Let's say the procedure's signature is as follows:
    create or replace procedure ProcessFamily( parentID number ) is ..
    --// processes a family (parent and children)
    ..Using DBMS_JOB is pretty easy - when you start a job you get a job number for it. Looking at USER_JOBS will tell you whether that job is still in the job queue, or has completed (once off jobs are removed from the queue). The core of the this code will be a loop that checks how many jobs (threads) are running, and if less than the ceiling (e.g. it may only use 20 threads), start more ProcessFamily jobs.
    If the total number of threads/jobs to execute are known up front, then this ThreadManager can manually create a long operation entry. Such an entry contains the number of unit of works to do and then is updated with the number of units done thus far. Oracle provides time estimates for completion and percentage progress. This long operation can be tracked by most Oracle-based monitoring software and provide visibility as to what the progress is of the processing.
    The ProcessFamly procedure can also use parallel DML (if that makes sense). Or bulk processing (if needed). This approach is also scalable as h/w increases (server upgrades, new server h/w), so too does your ability to run more threads (aka jobs) at the same time.
    Now I'm not suggesting that you write a ProcessFamily() proc - I do not know the actual data and problem you're trying to solve. What I'm trying to convey is the basic principle for writing multi-thread/parallel processing software using PL/SQL. And it is not that complex. The critical thing is simply that the parallel procedure or thread be entirely thread safe - meaning that multiple copies of the same code can be started and these copies will not cause serialisation, dead locking, and other (application designed) problems.

  • How do I delete some pages from an existing pdf file?

    I have an existing pdf file that is too large to send to some people. How can I delete some pages from this existing pdf file, and break it up into two files?

    Acrobat
    You can download a 30 day trial at that link.
    You may also be able to do it with CreatePDF, but I'm not sure.

  • I'm getting this problem when trying to update my iphone 3gs it says that the iphone software could not be contacted and I went on youtube got some advise to go into my hard drive to fix the error I have nothing in my host file please help me if you can

    I'm getting this problem when trying to update my iphone 3gs it says that the iphone software could not be contacted and I went on youtube got some advise to go into my hard drive to fix the error I have nothing in my host file please help me if you can this is all new to me.

    Read this: iOS 4: Updating your device to iOS 5 or later
    ... oh I think it is a 3gs or a 3
    This makes a difference. What does it say in Settings > General > About?

  • I lost my password and i could get into my phone, i tried but it said connect to itune. i did, but i did not get any result. please give me some advises how do i get my password back or reset with a new one?

    Ipjone6, silver, 64GB
    I lost my password and i could get into my phone, i tried but it said connect to itune. i did, but i did not get any result. please give me some advises how do i get my password back or reset with a new one?

    how to reset password:
    https://iforgot.apple.com/password/verify/appleid

  • I don't know what i need. I'am a mac user but i need to run quick books premier. This is the only software i need in windows 7. Could i have some advise in  what is better for me, Bootcamp or parallels

    I don't know what i need. I'am a mac user but i need to run quick books premier. This is the only software i need in windows . Could i have some advise in  what is better for me, Bootcamp or Parallels

    The Intuit rep said they don't "support" QuickbooksPremier on a "virtual machine." Do you know what I risk by using it, anyway? thanks for the advice about Boot Camp vs Parallels, BTW!
    I use QuickBooks Pro for Mac, so I haven't had need to try any of the Windows versions in a VM. But I can't think why it wouldn't work. From within the VM, QuickBooks Premier would believe it is operating on PC hardware within Windows.
    I would guess they mean that the multiple user support wouldn't work from within the VM. But I would think that would also work. Windows can see the Internet from within the VM, which means it can see your network. So if Windows can see the network, then QB Premier should be able to, too.
    I know you can get Parallels as a demo, and maybe you could get QB Premier as trial software. So if you already have a retail copy of Windows to load into a VM, it would only cost you time to test what's possible.

  • SSRS 2008 R2 - Try to do some changes on an existing rdl - unexpected erro "External Component Has Thrown an Exception"

    Hi, 
    I am working on SSRS 2008 R2 -  Tried to do some changes on an existing rdl & save -  An unexpected error "External Component Has Thrown an Exception"  pop up 
    Any suggestions please to resolve it.
    thank you !!!
    best regards,
    Venkat

    Hi Venkat,
    The issue may be caused by the Visual Studio tried to close an invalid handle. This problem may happen if the operating system is a debug version, not a retail version. Please refer to the following steps to check.
    1. Right-click on "My Computer".
    2. Click "Properties".
    3. Make sure there is no "Debug" words at the end of the "Windows edition" section.
    Reference:
    http://connect.microsoft.com/SQLServer/feedback/details/467954/sql-server-2008-install-on-windows-server-2008-fails-with-external-component-has-thrown-an-exception
    If the operating system is debug version, please re-install the operating system with retail version to solve the issue.
    Hope this helps.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • How to use where exists with a subquery

    Hi,
    Below is my query
    select DISTINCT
    -1,
    vODS_GLBalance.PageNum,
    vODS_GLBalance.FiscalYearId,
    vODS_GLBalance.FiscalMonthOfYearId,
    GLAmount
    From ODS.Staging.vODS_GLBalance
    where EXISTS
    select *
    From ODS.Common.tODS_Date
    where dateid not in (-1,99991231)
    AND convert(date,convert(varchar,FiscalYearId)+'-'+convert(varchar,FiscalMonthOfYearID)+'-01') between dateadd(month,-2,getdate()) and dateadd(month,-1,getdate())
    Order BY FiscalYearId ASC,
    FiscalMonthOfYearId ASC
    My subquery inside the where exists just brings the date for current month,so i want to limit my whole data only for current month,but if i run the whole query it returns me all the data i have in my staging table.
    Any suggestions please?
    Thanks

    You need to correlate the subquery with the outer query, like in this example:
    SELECT *
    FROM   Customers C
    WHERE  EXISTS (SELECT *
                   FROM   Orders O
                   WHERE  C.CustomerID = O.CustomerID)
    That is, show me all customers who have placed at least one order.
    I can't give an example with your queries, because I don't know how they are structured.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Bought a TV season and only some episodes downloaded where remaining had "download error" on iPad 1

    Bought a TV season and only some episodes downloaded where remaining had "download error" on iPad 1? Tried many times for few days with no use. Tried restarting too. Device has enough memory too!

    Because of the error message, I'm not sure if any of this will work, but I suppose it's worth a shot.
    Sign out of your account, restart the iPad and then sign in again.
    Settings>Store>Apple ID. Tap your ID and sign out. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Go back to Settings>Store>Sign in and then try to resume the downloads.
    If the TV shows appear at all in the videos app - did you try tapping and holding down on the icons to see if the X to delete pops up? Is there any evidence of the stalled downloads on the iPad in the videos app? If you could delte them, you might be able to resume the downloads.
    If you live in the U.S., Canada, The UK or Australia, TV shows can be downloaded again at no charge as long as you use the same Apple ID.

  • Select count(*) where exists (takes 5 hours).

    Hello Gurus,
    I have two databases on two servers, I am counting how many rows are similiar on two tables that are identical, and the rows should be identical as well. I am running a select count(*) where exists query and it takes 5 hours to complete.
    Each table only has two million rows.
    What can I do to speed it up?

    5 hours to process 2M rows does sound a bit long :(
    I didn't see this mentioned explicitly, but I thought the idea of comparing data on 2 servers implied a database link. Tuning distributed queries can be nasty.
    Start by getting an execution plan of the query to figure out what it is doing. Compare that to the plan generated by the already suggested MINUS operator. You'll need to do MINUS twice with each query in the other's position the second time. Alternately, check the indexing on the subqueries; EXISTS tends to work best with fast indexed lookups. FTS on an EXISTS subquery is not good :(
    Think about copying the data locally to one system or the other first, maybe in a materialized view or even global temporary table.
    Finally, think about tuning the transfer. There are articles on Metalink on tuning the transfer packet sizes (SDU/TDU) which might help IF YOU ARE ON UNIX; I haven't had any luck changing these values on Windows. You can also look into setting tcp.nodelay which can affect when packets get sent (another Metalink article should cover this).

  • Since I installed lion, my SxS Card reader is not working any more. Some advise?

    since I installed lion, my SxS Card reader is not working any more. Some advise?

    Try resetting the PRAM https://support.apple.com/kb/HT1379

  • Does anyone know how I turn negatives into a positive on Aperture please?  I have scanned  a bunch of negs and want ot make a contact sheet. Would really appreciate some clues on where to start.  Thanks

    does anyone know how I turn negatives into a positive on Aperture please?  I have scanned  a bunch of negs and want ot make a contact sheet. Would really appreciate some clues on where to start.  Thanks

    Yeah, it's simple. You scan your images singly, then import them. Then, one by one adjust them. Under the adjustment brick, pull up the CURVES tool. It is one of dozens available from the pulldown menu on the left side.
    So, with your image in view, you click on the adjustment tool, select CURVES (which will be at the bottom of a few other adjustment sliders such as EXPOSURE) under the Histogram and then grab the bottom of the right hand curve and swing it all the way to the left. Then grab the left hand curve and drag it all the way to the right.
    The right curve represents highlights. The left curve represents shadows. Now the two are reversed. Your negative is now a positive. For added control, you can create mid-tone curves of your own and make finer adjustments. I haven't done this much so the experts might weigh in here with corrections and added advice.

  • HT2305 Hi Other Users, can someone please advise me where i can get a Leopard download for my Power Pc G5?

    Hi Other Users, can someone please advise me where i can get a Leopard download for my Power Pc G5?

    eBay is another source for Mac OS X Leopard 10.5; however be sure to ONLY purchase the retail disk shown below and not a grey computer specific disc:

  • Probably Really Simple Solution (Where Exists in Update Statement)

    Right,
    I have one table. In this table there are 5 fields for arguments sake:
    COLUMN_ONE COLUMN_TWO COLUMN_THREE COLUMN_FOUR COLUMN_FIVE
    On this table there will be duplicate records, but only column 1, column 2 and column 3 on these "duplicate" records will be the same, column 4 will differ (column 4 is not a unique identifier, but if there are duplicate records it will be different between at least 2 records). Column 5 is not yet populated, it's all null.
    I need a way of updating column 5 on these duplicate records. However, I would only like to update it on one of the records and the criteria for this will be where column_4 = 'hello.'
    So far I've came up with a update statement similar to the following but I don't know where to with it:
    UPDATE DANS_TABLE
    SET COLUMN_five = 'DUPLICATE'
    WHERE EXISTS (SELECT column_one||column_two||column_three, COUNT(*)
    FROM DANS_TABLE
    GROUP BY column_one||column_two||column_three
    HAVING ( COUNT(*) > 1 )) and column_four = 'hello';
    Thanks a lot for any help!!! Very much appreciated,
    Dan

    Here is the query that updates only one duplicate row for column_five. Hope this helps..
    UPDATE DANS_TABLE x1
    SET COLUMN_five = 'DUPLICATE'
    WHERE EXISTS
    select r_id from
    ( select max(rowid) r_id,column_one||column_two||column_three
    from DANS_TABLE t1 where exists
    select str from
    SELECT column_one||column_two||column_three str, COUNT(*)
    FROM DANS_TABLE
    GROUP BY column_one||column_two||column_three
    HAVING ( COUNT(*) > 1 )
    ) t2 where t2.str = t1.column_one||t1.column_two||t1.column_three
    ) group by column_one||column_two||column_three
    ) x2 where x1.rowid=x2.r_id
    ) and column_four = 'hello';

Maybe you are looking for

  • Alien communique​, print queue lagging, printer refuses to e-print, can't find with laptop

    I purchased the HP Photosmart Plus e-All-in-One Printer - Black (CN216A#B1H) to replace my top-feed printer whose ink was disappearing from retail stores. It is connected to my Mac Mini (OS: leopard 10.5) via USB, and to my home wifi network. I have

  • FDM between conditional mapping across dimensions

    Okay, I have searched long and hard, and did not find an answer on this one. Conceptually, my problem is simple. What I want to do, is set the value in the ICP dimension to '[ICP None'] based on the value in the account dimension. Simple enough. Prob

  • How do you load an AS2 swf into AS3?

    I think this is the way around my dilemma. How do you load and AS2 .swf into an AS3 file? thanks again! Steve

  • Why can't I sign in to face time?

    I just updated my iPod touch 4th generation 8 gigs to 4.3.2 and FaceTime isn't working, I can't sign it, it either tells me Check network connections, or wrong password, I did a full reset settings, still didn't work, so I did a full restore, set it

  • Display trouble

    please help me, this is stupid but some how i cannot manage to connect the tv (LG LCD) as a display computer recognises it but TV shows "no signal"