Flowdock
method

optimizer_hints

Importance_1
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - Class: ActiveRecord::QueryMethods
optimizer_hints(*args) public

Specify optimizer hints to be used in the SELECT statement.

Example (for MySQL):

Topic.optimizer_hints("MAX_EXECUTION_TIME(50000)", "NO_INDEX_MERGE(topics)")
# SELECT /*+ MAX_EXECUTION_TIME(50000) NO_INDEX_MERGE(topics) */ `topics`.* FROM `topics`

Example (for PostgreSQL with pg_hint_plan):

Topic.optimizer_hints("SeqScan(topics)", "Parallel(topics 8)")
# SELECT /*+ SeqScan(topics) Parallel(topics 8) */ "topics".* FROM "topics"
Show source
Register or log in to add new notes.