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

Improve handling of partial keys #206

Open
wants to merge 1 commit into
base: gcos4gnucobol-3.x
Choose a base branch
from

Conversation

ddeclerck
Copy link
Contributor

This PR improves handling of partial keys, to ensure BDB always compares keys of identical length (which would trigger an error when using a non-native collating sequence, since the custom comparison function enforce keys of same length).

Copy link
Collaborator

@GitMensch GitMensch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks clean - let's get that upstream!

@ddeclerck
Copy link
Contributor Author

Just for you to know I ran some perf test on this, and my findings are as follows:

  • I measure similar performance with and without this patch when using BDB's default comparison function
  • when using the custom comparison function, this patch (which uses indexed_key_compare to compare keys of identical length) yields better performance than a non-patched version that uses a comparison function that considers keys of different lengths (cob_cmp_strings)

So this would confirm this patch is the right approach.

As you already approved this, I'll merge upstream in a moment.

@ddeclerck ddeclerck force-pushed the fix_bdb_partial_key branch from 2f6fe33 to 0a682d9 Compare January 6, 2025 11:12
@ddeclerck
Copy link
Contributor Author

Merged in SVN @ revision 5412.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants