3

update statistics vs update index statistics

 1 year ago
source link: https://answers.sap.com/questions/13953306/update-statistics-vs-update-index-statistics.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
yesterday

update statistics vs update index statistics

44 Views

Hi, we talk about SAP - Sybase ASE, I have discussed this topic with many people around the world and I have not found anyone who knows how to give me a short and concise explanation on this topic. Let's see if there is an expert out there who can give me a hand.

I am aware that running "update index statistics" can:

1) Fill the tempdb database being used.

2) Actually, what this command does from behind is "update statistics <table> <field>" for each field of the index, doing sorts, locks and scans at the index level and at the field level on the table.

3) Execution time.

Now, I understand that if I execute "update index statistics" a histogram is generated for each field of the index which helps to define the cost of the index with most precision and the optimizer to choose it. But what happens if, for example, of three fields that have an index, the middle field is not informed as a predicate of the "where" clause?, I understand that the optimizer must do the necessary operations first to identify the uniqueness, if it exists , define the cost and then to see if it is the most optimal index. That is, using "update index statistics" seems more efficient than using "update statistics", but if this is the case, why doesn't the "update statistics" go away?.

Honestly, I'm lost, is there anyone out there to help me see the light at the end of the tunnel, I have a feeling this is the same as "which came first the chicken or the egg?"

Regards and thanks in advance

Javi.-


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK