TUNING QUERIES

  • I have a 4 parts of query in the first 3 parts iam inserting the output into a temporary tables(by using select into) .The 4th part of query is getting the data from these temporary tables .The first 3 parts are execuing very fast but 4th part is taking very late.When i saw the query execution plan HASMATCH/INNER JOIN IS TAKING 40%COST,and other table clusterindex scan is taking 35%.

    how to tune this query?

  • Have you seen this article?

    http://www.sqlservercentral.com/columnists/jsack/sevenshowplanredflags.asp

    What do the tables look like?  What does the query look like?

    One thing you might want to consider is creating temporary tables with indexes, populating them and then doing the select query in a separate stored procedure that you call from the first one (assuming that's how you're doing this).

  • Hi ,

    Thanks for ur reply iam creating the temporary tables by using select into (no indexes) the entire thing in one query itself.

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

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