0

Goal --> Try to find the execution time the query will take to display result before executing the query.

Detail Description --> I am trying to run an simple query , for Example one shown below, I am trying to find out how much actual time the query will take before running the query

SELECT top 1 *
FROM table_name
2
  • 1
    Possible duplicate of Is there any way/tool to identify estimate query run time in SQL sERVER Commented Jan 12, 2018 at 3:14
  • Logically, since there are so many different factors that would affect query time (processor, memory, connection speeds, indexes, statistics, cache, etc), that'd be hard to do. Commented Jan 12, 2018 at 3:19

1 Answer 1

0

The answer isn't fixed. You can run the query, have it take 5 seconds, repeat it and have it take less than one because some part of the query or results were cached.

Contention on tables makes a difference too. Selecting has to wait if it uses an index that's being updated.

All you can do is experiment to make estimates, potentially also using control L to get an estimated execution plan.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.