feat: add direct_read map column optimization#2248
Conversation
🦋 Changeset detectedLatest commit: 925f9f4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
93a701a to
ae7cac0
Compare
E2E Test Results✅ All tests passed • 176 passed • 3 skipped • 1218s
Tests ran across 4 shards in parallel. |
PR Review
|
Deep Review✅ No critical issues found. 🟡 P2 -- recommended
🔵 P3 nitpicks (16)
Reviewers (8): correctness, testing, maintainability, kieran-typescript, performance, adversarial, api-contract, learnings-researcher. Testing gaps:
|
Summary
We've known for a few weeks about an optimization that would allow for the
direct_readoptimization for thetextindex. This PR adds support fordirect_readwith the exact string matching in Lucene syntax based on a recommended column to add. Internal testing shows relevant queries sped up anywhere between 1.4-10x.How to test locally
Steps:
ALTER TABLE otel_logs ADD COLUMN ResourceAttributeItems Array(String) MATERIALIZED arrayMap((k,v) -> concat(k, '=', v), mapKeys(ResourceAttributes), mapValues(ResourceAttributes)) CODEC(ZSTD(1));ALTER TABLE otel_logs ADD INDEX idx_res_attr_items ResourceAttributeItems TYPE text(tokenizer = 'array');has(ResourceAttributes, concat(<key>, '=', <value>)References