Skip to content

Suggestion MySQL Index Hints #6370

Closed
Closed

Description

@bsapot

Has anyone thought about the ability to add index hints in queries for MySQL. I thought an option like useIndex could passed into the find functions.

Something like the following

var options = {
    useIndex: "my_fast_index"
};
mymodel.findAll(options);

I can look at submitting a PR if this interests anyone else.

Activity

  1. added
    type: feature
    on Aug 3, 2016
  2. janmeier commented on Aug 3, 2016

    @janmeier
    Member

    PR welcome :)

  3. mickhansen commented on Aug 3, 2016

    @mickhansen
    Contributor

    I'd like to see this kept plugin-level somehow.

  4. bsapot commented on Aug 3, 2016

    @bsapot
    ContributorAuthor

    @mickhansen by plugin level do you mean the mysql dialect?

  5. janmeier commented on Aug 3, 2016

    @janmeier
    Member

    Hard to do a plugin that does SQL generation (at least at the moment)

  6. sfaizanh commented on Sep 22, 2016

    @sfaizanh

    @bsapot Any update?

  7. bsapot commented on Sep 22, 2016

    @bsapot
    ContributorAuthor

    I have it done I just need to write the tests. I probably won't get to it for about a month.

  8. anthonyu commented on Feb 23, 2017

    @anthonyu

    @bsapot I would love to be able to use this code. Please submit the PR or push what you have so far to a fork. Thanks!

  9. stale commented on Jun 29, 2017

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment 🙂

  10. jessethomson commented on Apr 12, 2018

    @jessethomson

    Did this ever happen? This functionality would be amazing.

  11. jessethomson commented on May 16, 2018

    @jessethomson

    I have an MR ready for this feature but it was closed and a new issue was created so we can have an API design discussion first. We would like to support MySQL, MSSQL, SQLite.

    Anyone interested in this feature should go here:
    #9421

    And thumbs up it and/or contribute to the api design discussion 😄

  12. monukanyal commented on Oct 5, 2018

    @monukanyal

    Is this feature added now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    staletype: feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions