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

Avoid unnecessary queries when finding or creating tags #839

Merged

Conversation

bduran82
Copy link
Contributor

This is an optimisation to avoid database queries when finding or creating a list tags in ActsAsTaggableOn::Tag find_or_create_all_with_like_by_name:

The list of tags to be retrieved is only updated once and refreshed again in case there is a tag name collision.

This solves #838 issue

@thromera
Copy link

Very much needed actually.

@jnimety
Copy link

jnimety commented Aug 28, 2017

I'm running into this performance problem with large numbers of tags too, the patch seems to fix the issue.

@gen0cide
Copy link

gen0cide commented Sep 4, 2017

Any idea when this could be merged into v5?

@toobulkeh
Copy link

Would love a merge on this

@bitops
Copy link

bitops commented Dec 17, 2017

👍 on this getting merged.

@Cremz
Copy link

Cremz commented Feb 8, 2019

This really needs to happen.
It's not only when there are many tags, even 5-10 is enough to make everything seems slow.
It makes one query for each tag, each query takes about 2 seconds. ( i have about 130k tags already). it's not efficient at all. I try to add one record, that takes 5 ms, but updating the tags takes up to 10 seconds

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.

8 participants