Results 1 to 7 of 7

Thread: SQL exec time

  1. #1
    Join Date
    Jul 2005
    Posts
    276

    Unanswered: SQL exec time

    I'm running an ETL script which my Manager apparently found will take 32 hours for execution.

    I would like to know how long will my query take to finish execution(atleast an approximate time) before i start running it. How can I achieve this?

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    You should ask your boss his secret for seeing into the future.
    Once you know his answer, please post it back here.
    Would it be helpful if you also knew the size of the results set returned before running the SQL statement?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    I believe you can't estimate that on entire result set; however, if it is possible to run this query on a sample data set (for example, 1000 records) and it takes 3.6 seconds, you can estimate that 1.000.000 records will take 1000 times x 3.6 sec = 3600 sec = 1 hour. It would be a very, very rough estimation and probably incorrect, but I can't do any better.

  4. #4
    Join Date
    Jul 2005
    Posts
    276
    Apparently he was using Session Browser in TOAD which gives the remaining time for the different jobs that are running in a schema.

    And what he says is, you can get an estimate by looking at the cost in the Explain plan, which if more, can take a long time to exec. He is not sure of the threshold for the cost though.
    Last edited by nandinir; 01-30-07 at 15:50.

  5. #5
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >you can get an estimate by looking at the cost in the Explain plan
    If the EXPLAIN_PLAN says the cost is 187256, how long will this query run?

    I will stipulate that the typically for SQL which produces identical result sets, the lower COST statement will complete with lower elapsed time.

    Comparing COST values between/across different SQL statements is a meaningless exercise.

    http://asktom.oracle.com/pls/asktom/...D:313416745628
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  6. #6
    Join Date
    May 2004
    Location
    Dominican Republic
    Posts
    721
    nandinir, tell your boss he's looking at wrong things here. Explain plan (sql*plus explain plan) could be miss-leading if statistics are not up to date.

    Littlefoot, what happens when parallel querys kicks in ?

  7. #7
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Parallel queries are forbidden.

    Just kidding! I still believe that my "method" is incorrect, but I can't do any better (just like I've already said).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •