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

Support higher maximum blob segment size #1197

Open
mrotteveel opened this issue Oct 12, 2024 · 0 comments
Open

Support higher maximum blob segment size #1197

mrotteveel opened this issue Oct 12, 2024 · 0 comments

Comments

@mrotteveel
Copy link
Member

mrotteveel commented Oct 12, 2024

Currently, the blob segment size is controlled by the connection property PacketSize, and this has a maximum value of 32767 (bytes). However, since Firebird 2.1, segment sizes of 64KiB - 1 are supported (though Firebird 2.1 and 2.5 have some issues because sometimes the value is cast to a SSHORT, as far as I know, Firebird 3.0 is the first where it really works).

There are some oddities with this maximum, because for op_get_segment the maximum is also the maximum size of the buffer used for transferring, so the largest value you can receive with op_get_segment when asking for 65535 is actually 65533 (and if the response is broken up in multiple segments, it can even be multiples of 2 shorter) because of the 2-byte length prefixes in the response buffer. When sending (op_put_segment), the maximum is 65535 bytes.

Support a larger maximum value, so blobs can be transferred more efficiently, at least for Firebird 3.0 and higher, and also consider deprecating PacketSize, and/or introduce an alternative property called BlobSegmentSize, as that seems to be the only thing controlled by PacketSize.

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

No branches or pull requests

2 participants