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

The patch on postgres is selecting every row from the table before updating #168

Closed
andymoon opened this issue Oct 4, 2017 · 5 comments
Closed

Comments

@andymoon
Copy link
Contributor

andymoon commented Oct 4, 2017

I believe the line

      return this._getOrFind(id, options)

should be

      return this._getOrFind(id, params)

https://github.com/feathersjs/feathers-sequelize/blob/edc431f82018b7f6f376030d05225b017f26bc41/src/index.js#L180

@daffl
Copy link
Member

daffl commented Oct 4, 2017

I think you're right. Can you describe the behaviour you are seeing? If it is what I think I'd be surprised that the tests (or somebody else) didn't catch it before.

@andymoon
Copy link
Contributor Author

andymoon commented Oct 4, 2017

With the debug level logs I can see it make two queries against the table one for the count the other for every row. The queries have no where clauses while the update does. I believe the first two queries are coming from the this._getOrFind function call.

@daffl
Copy link
Member

daffl commented Oct 14, 2017

I think that makes sense. Could you submit a PR with the change you proposed?

@andymoon
Copy link
Contributor Author

#169

@daffl
Copy link
Member

daffl commented Oct 14, 2017

Closed via #169

@daffl daffl closed this as completed Oct 14, 2017
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

No branches or pull requests

2 participants