Skip to content

feat: support expression indexes#154

Open
SteveLauC wants to merge 25 commits intotimescale:mainfrom
SteveLauC:feat/expression
Open

feat: support expression indexes#154
SteveLauC wants to merge 25 commits intotimescale:mainfrom
SteveLauC:feat/expression

Conversation

@SteveLauC
Copy link
Copy Markdown
Collaborator

@SteveLauC SteveLauC commented Jan 17, 2026

Still WIP...

@SteveLauC SteveLauC linked an issue Jan 17, 2026 that may be closed by this pull request
@tjgreen42
Copy link
Copy Markdown
Collaborator

This one's complex enough that I'd recommend preparing a design doc as a temporary part of the PR.

@SteveLauC
Copy link
Copy Markdown
Collaborator Author

This one's complex enough that I'd recommend preparing a design doc as a temporary part of the PR.

Yeah, I agree, let me write a design doc for the implementation

@SteveLauC SteveLauC force-pushed the feat/expression branch 2 times, most recently from f0c085d to 99a4c95 Compare January 27, 2026 05:04
@SteveLauC SteveLauC force-pushed the feat/expression branch 2 times, most recently from 1ce648f to 433ac69 Compare February 3, 2026 01:40
@SteveLauC
Copy link
Copy Markdown
Collaborator Author

Hi TJ @tjgreen42 , I’ve finished the design doc (see docs/expression_index.md). On the implementation side, everything is done except for the explicit index validation part, which needs us to merge #195 first.

It would be great if you take a look at it and give some feedback when you get a chance.

@SteveLauC SteveLauC marked this pull request as ready for review February 3, 2026 09:05
Index expressions stored in pg_index.indexprs always use varno = 1,
since the indexed table has RT index 1 at CREATE INDEX time. However,
when the same expression is evaluated in a query, the table’s RT index
may differ (e.g., in multi-relation queries).

This commit updates Var nodes in index expressions to use the table’s
actual RT index in the query tree, ensuring correct evaluation.
Ensure expression index evaluation uses the correct scan tuple and restore buffer release during recovery.
@tjgreen42
Copy link
Copy Markdown
Collaborator

tjgreen42 commented Mar 31, 2026

Hi TJ @tjgreen42 , I’ve finished the design doc (see docs/expression_index.md). On the implementation side, everything is done except for the explicit index validation part, which needs us to merge #195 first.

It would be great if you take a look at it and give some feedback when you get a chance.

Hi @SteveLauC, apologies for the radio silence, I missed this update! I can take a look later this week. Are you still interested in pushing this PR out?

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.

Support expression indexes

2 participants