This query runs slower than expected

  • This query runs slower than expected (compared to other similar queries on the same database and tables)

    Eg.

    Select table1.x, table2.y from table1 join table2 on table1.a = table2.b

    What are some likely cause of the problem.

  • No where clause.

    No index on the columns being joined.

    No index on the columns in the where clause (just in case you didn't specify it in your post).

    Using functions on columns in either the join or where clauses.

    Statistics out of date.

    Edit: You might want to look at the "Performance Problems" link in my signature.

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • anusha_yapa (9/6/2010)


    This query runs slower than expected (compared to other similar queries on the same database and tables)

    Eg.

    Select table1.x, table2.y from table1 join table2 on table1.a = table2.b

    What are some likely cause of the problem.

    Great post! It's very nice. Thank you so much for your post.

    __________________

    Watch Resident Evil: Afterlife Online Free

Viewing 3 posts - 1 through 3 (of 3 total)

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