What are index hints?

Posted on

Question :

I saw a comment from @RicardoPontual that mentioned density-based index hints


Your question seems pretty confusing .. it starts with a very basic thing
  such as “how do I do a procedure on sql server”, which is too simple for
  find on Google and ends up talking about index hints based on
  density , something very advanced, does not make much sense to me

This gave me some doubts, I know them:

  • What are hints of index?
  • What are density-based hints ?
  • Are there other types of hints ?
  • Would it be possible to add examples, regardless of the database?

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

obsĀ²: If I used some term incorrectly, you can correct it in the question


Answer :

I do not know if the context is this, but hint (hint) is a way for the database programmer / user to tell how he wants the query to be executed , informing the index (s) to be used and how they will be used. Not all database systems have this functionality, but for this reason you can not put examples.

Generally it is not recommended to use unless you have a very strong relational algebra domain and are aware of existing data and know that your configuration will not change significantly to the point of harming rather than helping. Almost always the database will do a better service, should only use when clearly it is wrong and you can give a more appropriate tip. He is not required to follow. Without deep understanding of the database operation will do more harm than good.

It may be that this tip is indicating the data density for the index to be used, this is usually only needed when you need the performance right from the start, then the database can produce better statistics, or do not need to. But I do not know if any database allows this.

I do not know the context, it could be that I was talking about density like the index hash ( other ). Or a spreadsheet-based indexing method.

SQL Documentation Server .


Leave a Reply

Your email address will not be published. Required fields are marked *