Hint (SQL)

In various SQL implementations, a hint is an addition to the SQL standard that instructs the database engine on how to execute the query. For example, a hint may tell the engine to use or not to use an index (even if the query optimizer would decide otherwise).

Implementation

Different database engines use different approaches in implementing hints.

  • MySQL uses its own extension to the SQL standard, where a table name may be followed by USE INDEX, FORCE INDEX or IGNORE INDEX keywords.[1]
  • Oracle implements hints by using specially-crafted comments in the query that begin with a + symbol, thus not affecting SQL compatibility.[2]
  • Postgres PlusĀ® Advanced Server (a proprietary version of PostgreSQL from EnterpriseDB) offers hints compatible with those of Oracle.[3][4]
  • Microsoft SQL Server offers hints via the OPTION keyword [5]
gollark: Also not on any reasonably cheap phone I know of.
gollark: Yes, BADLY.
gollark: I will be so happy when I can get a phone which runs ACTUAL CONFIGURABLE GNU/LINUX.
gollark: Also, my internal memory thing reads as having about 50 partitions for some reason?!
gollark: I just want to *not* use my mobile network provider's DNS! WHY IS THIS SO HARD!

See also

References


This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.