Tag Info

New answers tagged

2

SQL Server uses statistics to determine an execution plan. If an index is available, so are statistics, and SQL server will determine the path of least work. This could be using the index or doing a table scan. In your example SQL server has determined that a table scan is less work than doing an index seek and a bookmark lookup. What you can see is that ...


0

Can you change the update? In general "or" clauses are bad for performance / index usage. If you would do 2 updates, First update with one of the keys: update ... WHERE IsProcessed = 0 AND EnrichedVendor = '1024' and the rest of the rows: update ... WHERE IsProcessed = 0 AND Vendor_No = 'NFL' and EnrichedVendor != '1024' Usually this kind of approach ...


3

The EnrichedVendor is not the same in the queries. I suspect that when you get a table scan you are working with products where the EnrichedVendor has a good majority of all the records in the table and therefore it makes sense to read all the table and the other EnrichedVendor has a much smaller percentile of the total records in the table. But you also ...


9

I think my understanding of the second estimate is incorrect and the differing numbers seems to indicate that. What am I missing? Using the SQL Server 2012 cardinality estimator, the selectivity of the join drives the estimated number of rows on the inner side of the nested loops join, and not the other way around. The 11.4867 number is derived (for ...



Top 50 recent answers are included