DBTNG should support query options (SELECT SQL_NO_CACHE, INSERT IGNORE, etc.)

Created on 30 January 2012, over 12 years ago
Updated 19 June 2023, about 1 year ago

While options are not a good plan for Drupal Core, there are a lot of benefits from properly using SQL_CACHE / SQL_NO_CACHE / HIGH_PRIORITY / SQL_CALC_FOUND_ROWS in custom code where the back-end database is a known type.

AFAICT there's no way to use query options with DBTNG. At best I can do

$query = db_select('foo', 'f')
  ->fields('', array('SQL_NO_CACHE'));

Which unfortunately produces:

SELECT .SQL_NO_CACHE ...

One way to implement this would be something like:

$query = db_select('foo', 'f')
  ->addOption('SQL_NO_CACHE')
  ->addOption('HIGH_PRIORITY');
✨ Feature request
Status

Closed: won't fix

Version

9.5

Component
DatabaseΒ  β†’

Last updated about 15 hours ago

  • Maintained by
  • πŸ‡³πŸ‡±Netherlands @daffie
Created by

πŸ‡¨πŸ‡¦Canada dalin Guelph, πŸ‡¨πŸ‡¦, 🌍

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Wonder after 10 years if this is still desired?

  • Status changed to Closed: won't fix about 1 year ago
  • πŸ‡¨πŸ‡¦Canada dalin Guelph, πŸ‡¨πŸ‡¦, 🌍

    No, not still desired. If you are doing something that requires such high database performance, you are not going to use Drupal for.

Production build 0.69.0 2024