What are index hints?

Asked

Viewed 151 times

7

I saw a comment from @Ricardopunctual that mentioned Density-based index hints

your question seems very confusing. it starts with a very basic thing such as "how do I process in sql server", which is too simple to find in Google and end up talking in index hints based on density, something very advanced, doesn’t make much sense to me

It gave me some doubts:

  • What are hints index?
  • What are hints density based index?
  • There are other types of hints?
  • It would be possible to add examples, independent of the database?

BS¹:If you have something more on the subject, feel free to add

BS²:If I used any term erroneously, can correct the question

  • In Oracle is a tip that you , carbon unit , humbly , with due reverence , gives to the execution analyzer, by experience I say in few cases works , but I’ve had significant improvements with a simple "hint". https://docs.oracle.com/cd/B19306_01/server.102/b14211/hintsref.htm#i8327

1 answer

5


I don’t know if that’s the context, but hint (tip) is a form of the programmer/database user to say how he wants the query is executed, informing the index(s) to be(s) used(s) and how they will be used. Not all database systems have this functionality, so it is not possible to put examples.

It is generally not recommended to use, unless you have a very strong relational algebra domain and are aware of the existing data and know that your configuration will not change significantly to the point where the hint does more harm than help. Almost always the database will do a better service. It should only use when clearly it is wrong and you can give a more appropriate tip. And he is not obliged to follow. Without deep understanding of the functioning of the database will cause more harm than good.

It may be that this tip is indicating the data density for the index to be used, usually this is only necessary when it needs performance right from the start, then the database can produce a better statistic, or not accurate. But I don’t know if any database allows something like this.

I don’t know the context, maybe I was talking about density like the index hash (another). Or a scattering-based index use method.

SQL Server Documentation.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.