Skip to main content
First revision based on a comments left by users 32281, 143823
Source Link
user126897
user126897

Community wiki answer:

Start by fixing the Key Lookups. They're mostly for predicate evaluation, and the estimated number of executions is bananas.

Unless old data is being archived, you will always run into trouble with this query, since you are selecting everything stored before today. No matter how much you tune, one day it will be too much to handle. A quick hint: notice the "select distinct", quite an important part of the view (120 lines). A "select distinct" shows you're selecting too much an have to throw the doubles away. Run that part without the distinct, find out where the doubles come from and find a way to avoid them.

Start by fixing the Key Lookups. They're mostly for predicate evaluation, and the estimated number of executions is bananas.

Unless old data is being archived, you will always run into trouble with this query, since you are selecting everything stored before today. No matter how much you tune, one day it will be too much to handle. A quick hint: notice the "select distinct", quite an important part of the view (120 lines). A "select distinct" shows you're selecting too much an have to throw the doubles away. Run that part without the distinct, find out where the doubles come from and find a way to avoid them.

Community wiki answer:

Start by fixing the Key Lookups. They're mostly for predicate evaluation, and the estimated number of executions is bananas.

Unless old data is being archived, you will always run into trouble with this query, since you are selecting everything stored before today. No matter how much you tune, one day it will be too much to handle. A quick hint: notice the "select distinct", quite an important part of the view (120 lines). A "select distinct" shows you're selecting too much an have to throw the doubles away. Run that part without the distinct, find out where the doubles come from and find a way to avoid them.

Source Link
user126897
user126897

Start by fixing the Key Lookups. They're mostly for predicate evaluation, and the estimated number of executions is bananas.

Unless old data is being archived, you will always run into trouble with this query, since you are selecting everything stored before today. No matter how much you tune, one day it will be too much to handle. A quick hint: notice the "select distinct", quite an important part of the view (120 lines). A "select distinct" shows you're selecting too much an have to throw the doubles away. Run that part without the distinct, find out where the doubles come from and find a way to avoid them.

Post Made Community Wiki by user126897