March 3, 2022 at 12:07 am
I work on sql server 2012 i read more about statistics is very good for enahnce performance query
when or which cases i can use in it
can you show please
i don't need links or articles
i need only cases i use statistics and if i show execution plan
what indicator on execution plan that say
there is no statistics or remaining statistics
please help me
i read more about statistics and enhance large tables
so when i use it and which case or indicator execution plan that tell me must use statistics to enhance performance
March 3, 2022 at 2:44 pm
ALL cases.
All of them. Statistics are what the optimizer uses to determine how many rows are likely to be returned from a given table or index. Without statistics, the optimizer will always scan and perform hash joins. You'll likely never see a seek or other kinds of joins where they would be appropriate based on the data & the query.
And it's not a question of YOU using statistics. The optimizer uses statistics. You need do nothing.
EXCEPT
You need to ensure that the automatic creation and update of statistics is enabled (in the vast majority of cases, there are exceptions where you turn these off, but they are exceedingly rare exceptions). Next, identify places where the automatic maintenance is not adequate and provide manual maintenance.
You simply have to ensure that statistics are there for the optimzer and that they are as accurate as possible. You don't need to interfere in any other way to ensure that statistics are used.
For scads more detail, I'd suggest getting a copy of my books linked below.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply