SQL Query Execution time

  • Hi, what is an acceptable SQL Query Execution time?  Is 3 minutes acceptable?  What is an unacceptable amount of time?

  • TJ_T wrote:

    Hi, what is an acceptable SQL Query Execution time?  Is 3 minutes acceptable?  What is an unacceptable amount of time?

     

    It depends on the business, mostly as quick as possible.

    Muthukkumaran Kaliyamoorthy
    https://www.sqlserverblogforum.com/

  • Assuming you are talking about SELECT statements, it really depends on the amount of data being retrieved.    But usually anything running for three minutes is NOT running efficiently.    Huge insert or update jobs are a different story.

     

     

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • it depends.

     

    if it is a select with just a few joins and small amount of data then 3 mins is too much (assuming server is capable and not hugely constrained)

    but on the other hand imagine a sql that does

    • join 20 tables
    • has 30 outer applies to do string manipulation and mathematical calculations
    • processes 30 million rows

    then 3 mins is probably good time

  • I'd consider is this database for a system that's online transaction processing or for a system that's a data warehouse?  For an OLTP system, 3 minutes is an eternity.  An OLTP system can have thousands of requests hitting the database per minute, and something taking 3 minutes is consuming resources (CPU and/or RAM) that other queries want.

    A data warehouse or some other reporting-only system may have some processes that take that long, depending on the size of the data and what is being reported on.

    Either way, the things to consider are:

    • how often is this 3 minute query run?
    • is it run during business hours or off hours?
    • is it blocking or causing resource contention for other processes?
    • can it be improved to perform better?
    • can it be automated to run at a different time?
  • Please don't ask dumb questions. Do you really believe that the payroll for the United States government query should execute anywhere near the query for your knitting club? A query should execute within a proper time for its environment. However, I have observed that no one has ever complained to me over the last 35 years that "your query runs too fast." Unless they were a consultant being paid by the hour.

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • JCelko strikes again.  If he keeps this up, no one will ask questions for the fear of being slammed.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply