Available in versions: Dev (3.19) | Latest (3.18) | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11 | 3.10 | 3.9

Oracle style hints in MySQL

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

Since more recent versions of MySQL, Oracle-style hints are now also supported. For example, this has always been possible in MySQL:

SELECT SQL_CALC_FOUND_ROWS field1, field2
FROM table1

 
create.select(field1, field2)
      .hint("SQL_CALC_FOUND_ROWS")
      .from(table1)
      .fetch()

But now, you can also use the Oracle syntax for hints:

SELECT /*+ MAX_EXECUTION_TIME(1000) */ field1, field2
FROM table1

 
create.select(field1, field2)
      .hint("/*+ MAX_EXECUTION_TIME(1000) */")
      .from(table1)
      .fetch()

References to this page

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo