Skip to content

Conversation

@taroface
Copy link
Contributor

@taroface taroface commented Oct 27, 2025

https://cockroachlabs.atlassian.net/browse/DOC-15227

  • Add / update pages for LTREE data type
  • Fix the data types table ordering on previous versions

Preview: https://deploy-preview-20810--cockroachdb-docs.netlify.app/docs/v25.4/ltree.html

@netlify
Copy link

netlify bot commented Oct 27, 2025

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit abcc2b8
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-api-docs/deploys/69051fba3bfc9c00073d347d

@netlify
Copy link

netlify bot commented Oct 27, 2025

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit abcc2b8
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-interactivetutorials-docs/deploys/69051fba9b5b3d0008acff67

@netlify
Copy link

netlify bot commented Oct 27, 2025

Netlify Preview

Name Link
🔨 Latest commit abcc2b8
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/69051fbaa46beb00072a5edd
😎 Deploy Preview https://deploy-preview-20810--cockroachdb-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@mgartner mgartner left a comment

Choose a reason for hiding this comment

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

Looks great! I left two minor suggestions.

Also, as I was reviewing these docs and trying out LTREE features, I found three bugs!

I've marked them as known limitations for v25.4.0.


## Size

The size of an `LTREE` value is variable and equals the total number of characters in all labels plus the dot separators. The maximum label length is 1,000 characters, and the maximum number of labels in a path is 65,535.
Copy link
Contributor

Choose a reason for hiding this comment

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

That makes the max LTREE ~65MB. For STRING values we recommend keeping them under 64 kB:

https://www.cockroachlabs.com/docs/stable/string#size

The size of a STRING value is variable, but it's recommended to keep values under 64 kilobytes to ensure performance. Above that threshold, write amplification and other considerations may cause significant performance degradation.

Since an LTREE is stored like a STRING, I think we should make a similar recommendation here.

Copy link
Member

Choose a reason for hiding this comment

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

We actually currently have conflicting recommendations for BYTES and STRING even though they should be the same. This was mentioned just last week and Rich filed https://cockroachlabs.atlassian.net/browse/DOC-15179 about that. (I actually don't know what the recommendation should be nowadays, we'll need to figure that out.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted -- given Marcus's feedback I'll use the STRING guidance here for now, and if necessary it can be corrected after @rmloveland progresses on that issue.

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Nice work!


## Size

The size of an `LTREE` value is variable and equals the total number of characters in all labels plus the dot separators. The maximum label length is 1,000 characters, and the maximum number of labels in a path is 65,535.
Copy link
Member

Choose a reason for hiding this comment

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

We actually currently have conflicting recommendations for BYTES and STRING even though they should be the same. This was mentioned just last week and Rich filed https://cockroachlabs.atlassian.net/browse/DOC-15179 about that. (I actually don't know what the recommendation should be nowadays, we'll need to figure that out.)

Copy link
Contributor

@peachdawnleach peachdawnleach left a comment

Choose a reason for hiding this comment

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

Just one small comment, otherwise LGTM!


## Size

The size of an `LTREE` value is variable and equals the total number of characters in all labels plus the dot separators. Cockroach Labs recommends keeping values below 64 kilobytes. Above that threshold, [write amplification]({% link {{ page.version.version }}/architecture/storage-layer.md %}#write-amplification) and other considerations may cause significant performance degradation.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think here I would say "plus the total number of dot separators" just for clarity/consistency

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. Fixed!

@taroface taroface enabled auto-merge (squash) October 31, 2025 19:05
@taroface taroface merged commit 4ff971d into main Oct 31, 2025
5 checks passed
@taroface taroface deleted the ltree branch October 31, 2025 20:57
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.

5 participants