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

Too many queries on follow #92

Open
csoreff opened this issue Mar 11, 2017 · 0 comments
Open

Too many queries on follow #92

csoreff opened this issue Mar 11, 2017 · 0 comments

Comments

@csoreff
Copy link

csoreff commented Mar 11, 2017

user.follow(user2)

In this case we already have the two records and all of their information. So why does it do two SELECT statements to get them again before doing the INSERT into the follows table? We're doing one query to see if the follow already exists, two more queries to get the follower and followable, and then the insert. Four queries on every follow seems excessive.

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

1 participant