How long is it going to take?

Tables:
x_cart - 50,000 rows
x_1 | x_2
a11 | b11
c12 | g23
y_concat
x_all - 11,000,000 rows
a11_c12_g45
c12_g23
c12
a11_g23_b11_c12We need to count where x_1 and x_2 from x_cart table is found within x_all in y_concat table. So in example above we should get:
x_1 | x_2 | Total_count
a11 | b11 | 1
c12 | g23 | 2I have the following query to do this:
CREATE TABLE x_counts AS
  SELECT a.x_1,
         a.x_2,
         COUNT(1) AS total_count
  FROM   (SELECT x_1,
                 x_2
          FROM   x_cart) a
          JOIN y_concat b
           ON Instr (b.x_all, a.x_1) != 0
              AND Instr (b.x_all, a.x_2) != 0
  GROUP  BY a.x_1,
            a.x_2; But it is taking too long.
CREATE TABLE STATEMENT  ALL_ROWSCost: 341,329,480  Bytes: 94,386,107,624  Cardinality: 1,194,760,856Any suggestions to improve the code? If not can you roughly estimate how long it is gonna run?
Thanks
Edited by: zx8754 on 07-Jun-2010 05:00

CREATE TABLE x_counts AS
SELECT a.x_1,
a.x_2,
COUNT(1) AS total_count
FROM (SELECT x_1,
x_2
FROM x_cart) a
JOIN y_concat b
ON a.x_1 like 'b.x_all%'
AND a.x_2 like 'b.x_all%'
GROUP BY a.x_1,
a.x_2;
and create index over b.x_all
as like may use index id % is given on one side
No logging also may improve performace...

Similar Messages

  • How long is this going to take.... burning a biiiig project...

    ok here's the scenario... i have 2 hours of footage taken from a Cannon GL2 camera with excellent sound and such. I took the files and put them on an external hard drive using Premiere Pro.
    I am running Encord DVD 2.0 and the total of all the files I'm putting on the DVD is around 23 gigs. These are all un-transcoded and the program is now transcoding each of the files but since this is the first time i've done anything like this, I'm wondering if it's going to take all night or what...
    the burner i have is burning the info at 4X but I don't think it's gotten to the the burning phase yet... I have like 3 hours til i leave the office and I really hope I don't have to leave the computer here, but in any event...
    What do I need to do in the future to make sure this doesn't happen so slow or is there anything at all that can be done... I'm cool with waiting and all, but I just wanna know what to be prepared for.
    Thanks in advance!!!
    basic breakdown, I need to know the process that the program goes thru after the transcoding phase...and how i can transcode the stuff myself so it doesn't have to do this in the future...
    later guys!

    On a 1.75hr. Project, with 14 Timelines (AVI uncompressed and between 5min. and 25min.), AC3 DD SureCode 5.1 Surround, 2 "lead-in" AVIs (uncompressed), Main Menu & 3 Scene Selection Menus (non-animated, but with Audio), plus one Play All Playlist, it takes about 45 min. to Transcode (AVIs, Menus, etc.) and burn DVD-5 at 2.4x on my Plextor. No ROM content and all settings Automatic (4.3GB registered as size of Project on DVD).
    System:
    3.25GHz duo-core Intel, 4GB RAM, nVidia Quadro 4500FX-512MB and everything on 4-500GB SATAIIs. Plextor (plus another LG) is ATA-100.
    One thing jumps out at me in your original statement:
    i "put them on an external hard drive using Premiere Pro."
    What type of external HDD? Are you doing your Transcode of Assets from this(sounds like you are)? Can you place your Assets onto an internal HDD with plenty of room? One reason that I ask, is that I have had problems with PP2 running very, very slowly, when any Assets were on an external, whether FW-400, 800, USB or Gigabit LAN.
    Hunt

  • How long is it going to take to get my new iPhone 5?

    I pre ordered an iPhone 5 32gb from att. Will it ship out on September, 21st? If so where will it ship from and how long should I have to wait? The phone is being directly shipped to my house.

    Apple or whomever you ordered it from will send you an email with the ship date and tracking information.

  • I'm trying to download maps of the ranch but its taking forever for it to complete. says its enhancing map detail. how long is this going to take????? I need these maps up for work.

    I require google maps of the porperty we manage to do my job I purchased the ifarmer app to help organize and keep better track of details in equipment logs and cattle records. I'm trying to download maps of the property and its taking forever. it says it is "enhancing map detail" but its taken so long the ipod falls asleep and I don't know if that makes it take longer. I also can't do anything else on the ipod until it is done downloading. Is the amount of time its taking to download this map normal????

    Great
    Ok so this is what you need to do:
    You need to put it in DFU mode:
    How to enter iPhone DFU mode
    Connect the iPhone to your computer and launch iTunes
    Turn the iPhone off (hold down the power button at the top of the iPhone)
    Hold down the sleep/power button and home button together for exactly 10 seconds, then release the power button
    Continue to hold down the Home button until a message appears in iTunes telling you an iPhone in recover mode has been detected
    When you are in DFU mode your iPhone Screen will be completely black
    Even though the screen is black, that doesn’t mean the device can’t be interfaced with either iTunes or a custom firmware client (for jailbreaking, etc).
    Remember that if you see the restore logo, itunes logo or any message on the iPhone screen, you are not in DFU mode but standard Recovery Mode. Again, DFU mode is signified by having a completely black screen on the device. If anything else is the case, repeat the steps above until you enter into DFU mode successfully.
    Now you can restore - once restore is completed the Exit DFU mode
    Exit DFU mode on iPhone
    The simplest way to exit out of DFU mode is to hold down the Home and sleep/power buttons on the iPhone while connected to iTunes. Then just hit the power button as and this should reboot the device as usual.

  • Publishing to .avi - how long is this going to take?

    Captivate has been trying to publish my file to .avi for the past 10 hours.  Admittedly, it is a rather big file (51 static slides, 45 or so w/ audio each about 10 - 30 seconds of audio, publishing at 940 x 720 resolution).  Computer I'm using is a couple years old, but still should be ok (Athlon 64 bit processor, 2 gigs RAM).
    I have successfully published shorter (10 slide) projects but with identical settings to AVI (those took about 15 - 30 minutes).  Doing that math, this should have been finished in about 3 hours max.
    It's 10 hours later.
    Captivate is not hanging, and my processor is continually running at over 50% even w/ no other applications open, so I assume it's still working.
    I'm afraid to cancel and restart lest it's close to completing.  But then again I have a deadline for client and it's getting close.
    Also - why on earth is there no progress bar?  So I can tell how far along this actually is?  (I don't count the preview screen that pops up as a progress bar, as it never seems to match what is actually happening based on the other projects I published).
    Any suggestions?
    Thanks

    Hi there
    Sorry, no real helpful advice to offer here. Not other than to suggest that you report this to Adobe as well as suggesting to Adobe that they consider adding a progress indicator for this action. After all, they are continually working on either a patch or Captivate next.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • How long does restoring iPhone 3GS take in recovery mode through iTunes?

    how long does restoring iPhone 3GS take in recovery mode through iTunes?

    You are right there as a weard issue try with the battery comes out and then try to connect to the itunes should be working properly, if not fix the power on/off button because are escential to do it.

  • How long does Apple going to store my calander in iCloud

    Hello,
    I was wondering how long apple is going to store my calander in iCloud.
    I was wondering this because Photostream is deleting the photo's after 30 days from iCloud.
    Can anybody help me, because otherwise i'm not going to use iCloud for my calander.
    Thank you for helping with kind regards
    Cihan

    Your calendar is stored for as long as you want it to be. There is no time limit like for PhotoStream.
    The only limits are listed here: http://support.apple.com/kb/HT4489

  • How long does restore factory settings take?

    hi,
    I decided to reformat my memory card on my nokia 2730 because it got a virus from a friend's computer...
    then to make sure, i selected restore factory settings --> restore all and entered 12345 as the code since i have not changed my codes ever since i got the phone..
    now the screen says restoring settings. please wait.
    it has been around 30 minutes now and it still has this message on the screen.
    is this normal? how long does restore factory settings take?
    also, it's charging right now..
    so, what should i do?
    thanks in advance for your answers..

    20 seconds
    If  i have helped at all a click on the white star below would be nice thanks.
    Now using the Lumia 1520

  • I went on Itunes to install new software and backup. I has been running all night and still saying preparing Iphone for restore. How long is this suppose to take?

    I went on Itunes to install new software and backup. It has been running all night and still saying preparing Iphone for restore. How long is this suppose to take?

    Preparing your iPhone for restore its supposed to be about 1-2 minutes! Do you see any errors the time you plug in the wire from your iPhone to iTunes?

  • HT4060 How long does an Ipad 4 take to fully charge if battery is almost depleted ?

    How long does an ipad 4 take to fully charge if the battery is almost depleted?

    My iPad 4 takes 6 hours to charge from 0% to 100%

  • HT1600 How long does the Apple TV take to update? It looks as though mine got jammed! What do I do?

    How long does the Apple TV take to update? It looks as though mine got jammed! What do I do?

    Welcome to the Apple Community.
    Mine's usually about 5 minutes, but it wouldn't be more than 30-40, if it's any longer.......
    You can't do much else besides pull the plug. If it causes further problems you should be able to restore as below:
    Get yourself a micro USB cable (sold separately), you can restore your Apple TV from iTunes:
        1.    Remove ALL cables from Apple TV. (if you don't you will not see Apple TV in the iTunes Source list)
        2.    Connect the micro USB cable to the Apple TV and to your computer.
        3.    Reconnect the power cable (only for Apple TV 3)
        4.    Open iTunes.
        5.    Select your Apple TV in the Devices list, and then click Restore.
    On the other hand you may be able to simply start the update again. If however the update continues to fail, you should try the restore routine above.

  • Im updating my Iphone 5c with the latest apple update, but it isnt done after an hour... how long is it supposed to take?

    Im updating my Iphone 5c with the latest apple update, but it isnt done after an hour... how long is it supposed to take?

    Via iCloud on Wi-Fi about ten minutes at the most. Via iTunes, about the same.
    Reset your iPhone.
    Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears.
    Then tap Settings > General > About then scroll to Version. If it says:  7.1.2 then the update was complete.
    If not, follow the instructions for recovery mode >>  iOS: Unable to update or restore

  • HT1766 how long should an icloud restore take to an iphone?

    How long should an icloud restore take to an iphone?

    Nobody here would know. Depends on how big the backup file is.

  • HT1438 About how long should an ICloud backup take?

    About how long should an ICloud backup take?

    Well, it went from 8 to 10 to 12 to 18 to 22 hours...then it stopped and said can't restore from icloud. I guess I'll give itunes a shot.

  • HT1176 how long should an initial backup take?

    How long should an initial backup take?

    If the Mac is connected to the Time Capsule using an Ethernet connection, the backup will proceed on average at about 30-35 GB per hour.
    So, if you have 100 GB to backup, the process will be approximately 3 hours.
    Bets are off with a backup using wireless, but it will likely be at least 3-4 times longer than the wired Ethernet connection.

Maybe you are looking for

  • A/R Down Payment Invoice and A/R Invoice

    Dear Experts, I have thousands of A/R Down Payment Invoices (Not Yet Fully Applied) that were suppose to be applied to the correct A/R Invoice through an integration that didn't work.  Is there an easy way or any way to apply the down payments to the

  • Running an update statement on two dependent attributes

    Dear All, I have a repair_job table that contains values for work_cost, parts_cost and total_cost which is the sum of the work and parts cost values. I want to run an update statement that doubles the work cost and, naturally, updates the value of to

  • Total Problem in scripts

    Hi, I'm facing one big issue in scripts.ie: in printing totals.   for totals i write a subroutine in scripts.   it's working fine.it's displaying totals well.here my problem is first i see the print preview.at that time total is correct.but when i ca

  • TS1389 how do i authorize my computer

    i need to authorize my computer i my computer because i had two previous computers that broke an wanted to have only one computer showing as authorized this is really making me mad.  will some one help me fix the problem.   it says go to store click

  • Physical Data Service to Oracle Stored Procedure Package

    i'm calling a package with the following signature: PROCEDURE QUERY_ENTITY (      P_TABLE_NAME      IN      VARCHAR2, P_ENTITY_ID      IN      NUMBER, P_USER           IN      VARCHAR2, P_RECORDSET      OUT      CNODB_ENTITY_PKG.C_ENTITY); When defin