📑 Table of Contents

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

edit

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]
  • EDB Postgres 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]

See also

edit

References

edit
  1. ^ MySQL 5.5 Reference Manual: 12.2.9.3 Index Hint Syntax
  2. ^ Mike Ault: Oracle SQL Hints Tuning
  3. ^ "Postgres Plus Advanced Server Performance and Scalability Guide: Query Optimization Hints". Archived from the original on 2014-04-19. Retrieved 2013-06-24.
  4. ^ "Postgres Plus Advanced Server Oracle Compatibility Developer's Guide: Optimizer Hints". Archived from the original on 2014-04-19. Retrieved 2013-06-24.
  5. ^ MSSQL 2017 Documentation


📚 Artikel Terkait di Wikipedia

Hint

to a conclusion Hint (musician), musician Jonathan James from Sussex, England Hint (SQL), a feature of the SQL computer language Hint Water, a beverage

PostgreSQL

database management system (RDBMS) emphasizing extensibility and SQL compliance. PostgreSQL features transactions with atomicity, consistency, isolation,

PL/SQL

PL/SQL (Procedural Language for SQL) is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle

Full table scan

full table scan. A full table scan hint The hint lets optimizer to use full table scan. The first example shows a SQL statement that returns the name of

PHPEdit

INI, PHPEditScript, PHP, PlainText, SQL, XML, and XSLT Code Hint for HTML, SQL and PHP Code Insight for HTML, SQL and PHP Code beautifier Integrated PHP

Query optimization

many relational database management systems and other databases such as NoSQL and graph databases. The query optimizer attempts to determine the most efficient

Apache Pig

notation which makes MapReduce programming high level, similar to that of SQL for relational database management systems. Pig Latin can be extended using

Document-oriented database

categories of NoSQL databases, and the popularity of the term "document-oriented database" has grown alongside the adoption of NoSQL itself. XML databases