Skip to content

Conversation

wenym1
Copy link
Contributor

@wenym1 wenym1 commented Jul 8, 2025

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Convert

LogicalVectorSearch { distance_type: InnerProduct, top_n: 5, left: $2, right: OpenaiEmbedding('{"model": "model"}':Jsonb, 'hello':Varchar)::Vector(3), output_columns: [items.id:Int32, items.name:Varchar] }
    └─LogicalScan { table: items, columns: [items.id, items.name, items.embedding] }

to

└─BatchProject { exprs: [Field(Unnest($1), 1:Int32) as $expr1, Field(Unnest($1), 0:Int32) as $expr2, Field(Unnest($1), 2:Int32) as $expr3] }
  └─BatchProjectSet { select_list: [Unnest($1)] }
    └─BatchVectorSearch { schema: [:Vector(3), vector_info:List(Struct(StructType { fields: [("name", Varchar), ("items.id", Int32), ("__distance", Float64)] }))], top_n: 5, distance_type: InnerProduct, index_name: "vector_index", vector:  }
      └─BatchValues { rows: [[OpenaiEmbedding('{"model": "model"}':Jsonb, 'hello':Varchar)::Vector(3)]] }

in LogicalVectorSearch::to_batch when seeing vector index that covers the columns to query.

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • I have checked the Release Timeline and Currently Supported Versions to determine which release branches I need to cherry-pick this PR into.

Documentation

  • My PR needs documentation updates.
Release note

@wenym1 wenym1 changed the title impl feat(frontend): optimizer rule to select vector index Jul 8, 2025
@github-actions github-actions bot added type/feature Type: New feature. and removed Invalid PR Title labels Jul 8, 2025
@chenzl25 chenzl25 self-requested a review July 30, 2025 02:51
@wenym1 wenym1 force-pushed the yiming/explicit-table-index-type branch from 1c60219 to e4cec9c Compare July 31, 2025 08:45
@wenym1 wenym1 force-pushed the yiming/select-vector-index-optimizer-rule branch from 63a2944 to bfd8a57 Compare July 31, 2025 08:45
@wenym1 wenym1 changed the title feat(frontend): optimizer rule to select vector index feat(frontend): convert to read vector index on covering vector index Jul 31, 2025
@wenym1 wenym1 force-pushed the yiming/explicit-table-index-type branch from e4cec9c to 789b541 Compare August 1, 2025 10:54
@wenym1 wenym1 force-pushed the yiming/select-vector-index-optimizer-rule branch from bfd8a57 to 6e29b4d Compare August 1, 2025 10:54
@wenym1 wenym1 marked this pull request as ready for review August 4, 2025 03:36
@wenym1 wenym1 force-pushed the yiming/explicit-table-index-type branch from 789b541 to d8a5641 Compare August 4, 2025 03:46
@wenym1 wenym1 force-pushed the yiming/select-vector-index-optimizer-rule branch from 6e29b4d to bede3b3 Compare August 4, 2025 03:46
@wenym1 wenym1 force-pushed the yiming/explicit-table-index-type branch from d8a5641 to a18b930 Compare August 4, 2025 15:34
@wenym1 wenym1 force-pushed the yiming/select-vector-index-optimizer-rule branch from bede3b3 to 84ba3fb Compare August 4, 2025 15:35
@wenym1 wenym1 force-pushed the yiming/explicit-table-index-type branch from a18b930 to c2719c0 Compare August 5, 2025 08:32
@wenym1 wenym1 force-pushed the yiming/select-vector-index-optimizer-rule branch from 84ba3fb to de71f77 Compare August 5, 2025 08:32
@wenym1 wenym1 force-pushed the yiming/explicit-table-index-type branch from c2719c0 to 4bc209c Compare August 19, 2025 07:35
@wenym1 wenym1 force-pushed the yiming/select-vector-index-optimizer-rule branch 2 times, most recently from 2ef1073 to 713b89a Compare August 19, 2025 11:15
@wenym1 wenym1 force-pushed the yiming/explicit-table-index-type branch from 4bc209c to 81e5fc1 Compare August 19, 2025 11:15
@wenym1 wenym1 force-pushed the yiming/select-vector-index-optimizer-rule branch from 713b89a to 77e6061 Compare August 26, 2025 06:41
@wenym1 wenym1 force-pushed the yiming/explicit-table-index-type branch from 81e5fc1 to 4acda1e Compare August 26, 2025 06:41
Copy link
Contributor

@chenzl25 chenzl25 left a comment

Choose a reason for hiding this comment

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

LGTM

@wenym1 wenym1 force-pushed the yiming/select-vector-index-optimizer-rule branch from 77e6061 to de03433 Compare August 29, 2025 17:47
@wenym1 wenym1 force-pushed the yiming/explicit-table-index-type branch from 4acda1e to a839636 Compare August 29, 2025 17:47
@wenym1 wenym1 changed the base branch from yiming/explicit-table-index-type to graphite-base/22545 September 1, 2025 04:32
@wenym1 wenym1 force-pushed the yiming/select-vector-index-optimizer-rule branch from de03433 to dc66585 Compare September 1, 2025 11:38
@wenym1 wenym1 force-pushed the graphite-base/22545 branch from a839636 to 3acfaa6 Compare September 1, 2025 11:38
@wenym1 wenym1 changed the base branch from graphite-base/22545 to main September 1, 2025 11:38
@wenym1 wenym1 added this pull request to the merge queue Sep 1, 2025
Merged via the queue into main with commit a422cf3 Sep 1, 2025
31 of 32 checks passed
@wenym1 wenym1 deleted the yiming/select-vector-index-optimizer-rule branch September 1, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants