Skip to content

Read hypertable max time value with an ordered scan - #10379

Open
svenklemm wants to merge 1 commit into
mainfrom
sven/cagg_max
Open

Read hypertable max time value with an ordered scan#10379
svenklemm wants to merge 1 commit into
mainfrom
sven/cagg_max

Conversation

@svenklemm

@svenklemm svenklemm commented Jul 31, 2026

Copy link
Copy Markdown
Member

The max value of a hypertable's open dimension was read with a max()
aggregate. For UUID time columns the aggregate argument is an expression
that extracts the timestamp from the UUID. Because the argument is an
expression and not a plain column, the planner cannot rewrite the
aggregate into a min/max aggregate, so it reads every row instead.

Also lock down search_path for the SPI execution and fix a sql
injection vulnerability in the UUID path.

@svenklemm svenklemm changed the title sven/cagg max Read hypertable max time value with an ordered scan Jul 31, 2026
@github-actions
github-actions Bot requested review from akuzm and antekresic July 31, 2026 21:21
@github-actions

Copy link
Copy Markdown

@akuzm, @antekresic: please review this pull request.

Powered by pull-review

@svenklemm svenklemm added the force-auto-backport Automatically backport this PR or fix of this issue, even if it's not marked as "bug" label Jul 31, 2026
@svenklemm svenklemm added this to the v2.29.1 milestone Jul 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/hypertable.c 83.33% 0 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

The max value of a hypertable's open dimension was read with a max()
aggregate. For UUID time columns the aggregate argument is an expression
that extracts the timestamp from the UUID. Because the argument is an
expression and not a plain column, the planner cannot rewrite the
aggregate into a min/max aggregate, so it reads every row instead.

Also lock down search_path for the SPI execution and fix a sql
injection vulnerability in the UUID path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

force-auto-backport Automatically backport this PR or fix of this issue, even if it's not marked as "bug"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant