Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add query support for indexed artithmetic functions #2663

Open
alecgrieser opened this issue Apr 19, 2024 · 0 comments · May be fixed by #2674
Open

Add query support for indexed artithmetic functions #2663

alecgrieser opened this issue Apr 19, 2024 · 0 comments · May be fixed by #2674
Assignees
Labels
enhancement New feature or request planner Related to the query planner

Comments

@alecgrieser
Copy link
Contributor

Using FunctionKeyExpressions, we can support indexes on things like "a + b" or "a & b" (bitwise and). We should provide those as some built-in queryable function key expressions that allows us to define queryable indexes on the function results.

To make it work with Cascades, we should ensure that we have appropriate function values, and that we can match those during planning. We already have a few built-in function Values for things like addition, though there are a few others that we'll need to add for things like bitwise operators.

@alecgrieser alecgrieser added enhancement New feature or request planner Related to the query planner labels Apr 19, 2024
@alecgrieser alecgrieser self-assigned this Apr 19, 2024
alecgrieser added a commit to alecgrieser/fdb-record-layer that referenced this issue Apr 23, 2024
… functions

This adds a new `FunctionKeyExpression` representing some basic arithmetic functions on `long`s, including `sum` and `bitand` (useful for when long fields are used as bitsets, and the user wants to define an index on individual bits in the bitset). This includes adding support for expressing the expression as a `Value` so that it can be matched within the Cascades planner. From the first test fixture added, it appears that the planner can already handle basic queries on this field, though it doesn't always recognize when it can skip a record resolution (e.g., when the function value is in both the result set and the index or when the argument fields are indexed).

This resolves FoundationDB#2663.
alecgrieser added a commit to alecgrieser/fdb-record-layer that referenced this issue May 13, 2024
… functions

This adds a new `FunctionKeyExpression` representing some basic arithmetic functions on `long`s, including `sum` and `bitand` (useful for when long fields are used as bitsets, and the user wants to define an index on individual bits in the bitset). This includes adding support for expressing the expression as a `Value` so that it can be matched within the Cascades planner. From the first test fixture added, it appears that the planner can already handle basic queries on this field, though it doesn't always recognize when it can skip a record resolution (e.g., when the function value is in both the result set and the index or when the argument fields are indexed).

This resolves FoundationDB#2663.
alecgrieser added a commit to alecgrieser/fdb-record-layer that referenced this issue May 22, 2024
… functions

This adds a new `FunctionKeyExpression` representing some basic arithmetic functions on `long`s, including `sum` and `bitand` (useful for when long fields are used as bitsets, and the user wants to define an index on individual bits in the bitset). This includes adding support for expressing the expression as a `Value` so that it can be matched within the Cascades planner. From the first test fixture added, it appears that the planner can already handle basic queries on this field, though it doesn't always recognize when it can skip a record resolution (e.g., when the function value is in both the result set and the index or when the argument fields are indexed).

This resolves FoundationDB#2663.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request planner Related to the query planner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant