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

Arrangements created through casts duplicate data #27030

Open
frankmcsherry opened this issue May 10, 2024 · 2 comments
Open

Arrangements created through casts duplicate data #27030

frankmcsherry opened this issue May 10, 2024 · 2 comments
Labels
C-feature Category: new feature or request

Comments

@frankmcsherry
Copy link
Contributor

frankmcsherry commented May 10, 2024

Feature request

An index that uses an expression that casts the data, for example here from varchar to text, will maintain the payload twice: in both the key (as text) and in the value (as varchar).

CREATE INDEX t1_a_cast ON t1(CAST(a AS text));

Our mechanisms for going from row to (key, val) and back to row only allow projections for row -> val and [key, val] -> row, preventing the use of more general MirScalarExpr variants, including casts. More generally there are other crazy inverses one could apply (if the key is x/2, you could keep only the bit sheared off as the residual value), but realistically the casts are the clearest example of current problem and opportunity.

@frankmcsherry frankmcsherry added the C-feature Category: new feature or request label May 10, 2024
@teskje
Copy link
Contributor

teskje commented May 23, 2024

@mgree For your awareness. Could the mirtype design help with this issue as well?

@mgree
Copy link
Contributor

mgree commented May 29, 2024

mirtype would let us eliminate the cast wholesale, so... yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: new feature or request
Projects
None yet
Development

No branches or pull requests

3 participants