Skip to content

Conversation

@joshua-spacetime
Copy link
Collaborator

Fixes #260

Description of Changes

Generates index scans for point queries

API and ABI

  • This is a breaking change to the module ABI
  • This is a breaking change to the module API
  • This is a breaking change to the ClientAPI
  • This is a breaking change to the SDK API

If the API is breaking, please state below what will break

table_id: &TableId,
col_id: &ColId,
value: &'a AlgebraicValue,
value: &AlgebraicValue,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The changes in this file are just fallout from having Eq iterators own their Algebraic value.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why did we want them to own their own value? Might have missed the reason in the diff.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Mainly to avoid having these methods take two lifetime parameters. Previously these algebraic values' lifetimes were associated with the db object itself.

Copy link
Contributor

@Centril Centril left a comment

Choose a reason for hiding this comment

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

Seeing the code like this gave me a better understanding so I found an optimization opportunity and some simplifications

Copy link
Contributor

@mamcx mamcx left a comment

Choose a reason for hiding this comment

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

LGTM

@cloutiertyler
Copy link
Contributor

benchmarks please

1 similar comment
@drogus
Copy link
Collaborator

drogus commented Sep 15, 2023

benchmarks please

None
};

// If the first operation is an index scan, open an index cursor, else a table cursor.
Copy link
Contributor

Choose a reason for hiding this comment

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

It's a small thing but I don't love the thrashing the front of the vec query.query in the non-index-scan case. Would it be hard to only pop the front in that case, rather than pop and push from the front?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for pointing this out. Done!

@joshua-spacetime joshua-spacetime enabled auto-merge (squash) September 16, 2023 20:52
@joshua-spacetime joshua-spacetime merged commit 4490bea into master Sep 16, 2023
@joshua-spacetime joshua-spacetime deleted the joshua/260/index-scans branch September 16, 2023 21:43
bfops pushed a commit that referenced this pull request Jul 17, 2025
fixed typo:
"Next add let's add" -> "Let's add"
bfops pushed a commit that referenced this pull request Jul 17, 2025
## Description of Changes
SDK side of #2636
Addresses
clockworklabs/com.clockworklabs.spacetimedbsdk#281

## API

 - [ ] This is an API breaking change to the SDK

## Requires SpacetimeDB PRs
#2636

## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*

SpacetimeDB branch name: jgilles/on-unhandled-reducer-error

## Testing

- [ ] Add a test that this works to the regression-tests example module
bfops pushed a commit that referenced this pull request Aug 7, 2025
## Description of Changes
SDK side of #2636
Addresses
clockworklabs/com.clockworklabs.spacetimedbsdk#281

## API

 - [ ] This is an API breaking change to the SDK

## Requires SpacetimeDB PRs
#2636

## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*

SpacetimeDB branch name: jgilles/on-unhandled-reducer-error

## Testing

- [ ] Add a test that this works to the regression-tests example module
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.

Queries should use indexes when appropriate

7 participants