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

Better performance for unique slug checking #4

Closed
calvinl opened this issue Mar 21, 2018 · 1 comment
Closed

Better performance for unique slug checking #4

calvinl opened this issue Mar 21, 2018 · 1 comment

Comments

@calvinl
Copy link
Member

calvinl commented Mar 21, 2018

As of now, generating a unique slug means checking the slug against the database each time and then incrementing the count, checking again, and so on, until an unused slug is found. For slugs with a high count, this can mean checking against the database many times.

One method is to parse the suffix's count and increment once from there. However, this would not work with a custom generator (if #3 is implemented). Another way is to suffix with a UUID. A third way would be to allow both as default strategies for unique slugging, but this could have repercussions if the strategy is changed sometime during the lifetime of the application.

@calvinl calvinl closed this as completed Jun 3, 2018
@calvinl
Copy link
Member Author

calvinl commented Jun 3, 2018

Addressed in v3.0.0

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