ENH Increase performance of enum obsolete values for large tables#11987
Open
beerbohmdo wants to merge 1 commit into
Open
ENH Increase performance of enum obsolete values for large tables#11987beerbohmdo wants to merge 1 commit into
beerbohmdo wants to merge 1 commit into
Conversation
michalkleiner
requested changes
Jun 1, 2026
michalkleiner
left a comment
Contributor
There was a problem hiding this comment.
Thank you for opening the PR @beerbohmdo, appreciate it!
The test failures seem to be related to your change, could you have a look what might be going on?
Improving the performance on enums on large tables is a good area of focus 👍
4 tasks
Contributor
Author
|
Yes it does. The problem is how the enum currently works and that it may contains empty values (There is a issue for that). My code is optimized for that it explicitly add the But the test don't expect that value. I am currently not sure what todo. |
Contributor
Author
|
I just removed the addition of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I have a database with relative large tables. When I run db:build its hangs multiple minutes for checking if the database still contains old enum values.
I found the origin and patched it for me in the past. As we use postgres I think it be a niche issue.
I am not completly sure why, but for large tables this can be realy slow:
A group by does't help either.
My solution:
I fetch the current schema of the enum column, compare it to the new schema.
Than I check for the obsolete classes if any of them exists in the table. I don't know why but a EXISTS-Query is fast 🤷
Issues
Pull request checklist