Add execution plan warning for hard-coded estimations
When query plans have hard-coded estimates, like the 30% hard-coded estimate for < or > when adding multiple columns:
SELECT * FROM dbo.Users u WHERE u.UpVotes + u.DownVotes > 10000000;
Then the query plan operator that does that filtering should show a yellow bang. The estimates on that operator will be 30% of the number of rows in the table, regardless of whether the query uses a greater than, less than, and regardless of which number we put in the filter.
More info & demos: https://www.brentozar.com/go/nobangs
James Lupolt commented
This is a great suggestion. It would also be generally useful to provide some means of explaining how the estimate was derived in all cases, in addition to a warning that the estimate was derived from a constant instead of the histogram or density vector.
George Walkey commented
Upvoted thanks to Brent
Actually NOT hard coding an estimate is the right thing to do
Marc Scirri commented
I love this suggestion. The troubleshooting time it will save is very exciting!!
Mikael Ljunghorn commented
This sounds like a great idea. I would love to see an execution plan warning for this scenario.
Matthew Olson commented
I've been bit by this before, I think Brent has a great idea to help prevent an accidental overlook of this behavior.