I have the below SQL query which takes very long to run, but runs fast in TEST (Same data as PROD).
Our DBA added some index into the select statement to enhance performance, but still takes very long to finish.
So I am hoping someone would point out best practice that enhance performance.
And someone likely will if you post in the proper forum:
Please mark the thread ANSWERED and repost it. Before you repost read the FAQ for that forum about how to post a tuning request and the info you need to provide. That info includes:
1. The actual query (formatted so it can be read)
2. The table and index DDL for ALL tables/indexes involved
3. Row counts for the tables and query predicates
4. The actual execution plan
5. The full version of the DB
6. SPECIFIC info about the problem - 'takes very long to run' has NO MEANING at all. A query of 8 billion rows is going to take a long time to run and unless you post specifics no one will have any idea how many rows are possible.