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

Add docs for VARINT #4669

Merged
merged 2 commits into from
Feb 5, 2025
Merged

Add docs for VARINT #4669

merged 2 commits into from
Feb 5, 2025

Conversation

Tishj
Copy link
Contributor

@Tishj Tishj commented Jan 29, 2025

This PR fixes #4521

I've cherry-picked some interesting information from the PR, focusing on the storage aspect, as that's the most relevant difference between the other integer types (that and the incredibly high amount of digits of course)

Because of that, I've also added Size in Bytes to the existing table of integer types.

Add docs for VARINT
@Tishj Tishj requested a review from pdet February 3, 2025 11:26
| `USMALLINT` | - | 0 | 65535 | 2 |
| `UINTEGER` | - | 0 | 4294967295 | 4 |
| `UBIGINT` | - | 0 | 18446744073709551615 | 8 |
| `UHUGEINT` | - | 0 | 340282366920938463463374607431768211455 | 16 |
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we could also add VARINT here?

Copy link
Contributor Author

@Tishj Tishj Feb 5, 2025

Choose a reason for hiding this comment

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

I don't think that's a good idea.
The minimum and maximum are both incredibly huge, and the Size in Bytes is variable, which is exactly why I've made a separate section for it.

I do understand why it would fit there, because it is just a numeric like the others in the list, but it's giant

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, that's a summary, on top of the page, and most likely the only thing that 99.9% of the people will read from it, so that's why I think is important to add it there. The ranges might look "confusing" at first glance, but then readers can check the actual varint description you added, if it's not immediately clear to them.

I think for bytes you can have the range 4 - 2ˆ23 bytes. Min and max can be a value * 10^...

I can also do that in a later PR.

@szarnyasg szarnyasg merged commit 82eb955 into duckdb:main Feb 5, 2025
4 checks passed
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.

[duckdb/#13015] - Variable Integer Size Type needs documentation
3 participants