Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(select): add 'indexHint' option #9378

Closed
wants to merge 1 commit into from

Conversation

jessethomson
Copy link

@jessethomson jessethomson commented May 1, 2018

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

Description of change

I'm adding way to add index hints to a select query.

Example usage:

db.User.findOne({
    where: {
        email: 'joe@example.com',
    },
    indexHint: 'idx_name',
});

// This generates SELECT * FROM `User` USE INDEX (idx_name) WHERE ...

Here's an issue from a while ago requesting this feature. #6370
It went stale and was closed though.

(This is my first PR to open source/on github. I couldn't figure out how to get permissions to make a feature branch so I created a fork instead. If this is not desired I can change it.)

@sushantdhiman
Copy link
Contributor

sushantdhiman commented May 9, 2018

In past I have rejected this feature because there was little to no demand, but it seems now this feature is desired by some users.

There are three PRs related to this change #9378, #9409 & #8401

I suggest authors of these PRs or anyone else who want this feature to suggest an API #9421 and propose a single PR after API is finalized.

Looks like MySQL / MSSQL / SQLite support this feature. PR with support and tests for all these dialects will be appreciated

This was referenced May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants