Skip to content

docs: warn early that string and uuid keys slow traversal - #138

Merged
prrao87 merged 2 commits into
mainfrom
docs/integer-key-performance
Nov 7, 2026
Merged

prrao87 merged 2 commits into
mainfrom
docs/integer-key-performance

Conversation

@prrao87

@prrao87 prrao87 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Why

The CSR index only works with integer keys. With string or UUID keys, use_csr=True silently falls back to hash joins over whole tables at every hop. The query returns the same results but runs slower, and nothing warns the user. The docs said this, but only in a short tip late in Getting started ("anything else quietly uses joins"), under a Graph schema heading that doesn't mention performance, and on the CSR page. A user picking key types for a new graph could easily miss it until queries were already slow.

What changed

  • Getting started: a short "Use integer keys" tip right where the first graph's datasets and keys are defined. In plain terms: integer keys let the CSR go straight from a node to its neighbours, string keys make every hop scan whole tables with no warning, and path variables need integer keys too. It suggests adding an integer id column and keeping the UUID as a property, and links to Graph schema for details.
  • Graph schema: renamed "Keys and the CSR" to "Key types and traversal performance" so readers and agents searching for performance advice can find it. It now says that the fallback gives no warning, and that ids don't need to be consecutive (it previously suggested a "dense" id column, which isn't required).
  • The CSR index, "Should I turn it on?": the integer-key row now says in plain terms why this is the fast case and what the fused target lookup does. The UUID row says why it gains little. The closing note says the benchmarks use GDC SNB data with integer keys.

Validation

  • uv run --project docs --locked zensical build --strict: no issues, and the new cross-page anchor resolves.
  • uvx typos@1.26.0 .: clean.
  • Checked the documented behaviour with UUID keys on a small graph: csr_stats() is empty and plain hops plan as joins with no warning. A path variable query raises NotImplementedError with use_csr on and off.
  • The benchmark claim was checked against both benchmark runners, which load GDC SNB data with numeric ids.

🤖 Generated with Claude Code

Add an integer-key tip where the first graph is defined, give the key
section in Graph schema a performance-oriented heading, and spell out
the integer-key case and the benchmark key types on the CSR page.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Deploying lance-csr with  Cloudflare Pages  Cloudflare Pages

Latest commit: aaf3e0c
Status: ✅  Deploy successful!
Preview URL: https://dd886ee5.lance-csr.pages.dev
Branch Preview URL: https://docs-integer-key-performance.lance-csr.pages.dev

View logs

@prrao87
prrao87 marked this pull request as ready for review November 7, 2026 14:38
@prrao87
prrao87 merged commit 5aefb21 into main Nov 7, 2026
3 checks passed
@prrao87
prrao87 deleted the docs/integer-key-performance branch November 7, 2026 14:40
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.

1 participant