Skip to content

Don't loop over all tables in per-table expansion hook#10090

Open
akuzm wants to merge 5 commits into
timescale:mainfrom
akuzm:expand-one
Open

Don't loop over all tables in per-table expansion hook#10090
akuzm wants to merge 5 commits into
timescale:mainfrom
akuzm:expand-one

Conversation

@akuzm

@akuzm akuzm commented Jun 18, 2026

Copy link
Copy Markdown
Member

This looks like a leftover of the old approach where we expanded all hypertables at the beginning of the query. The current code expands all hypertables when the "set pathlist" hook is called for the first hypertable. This doesn't seem to lead to any problems, but this control flow looks unexpected. Just let the Postgres enumerate all tables in query normally, and in the hook, expand only the hypertable it is called for.

Needed to simplify the code in #9315

This looks like leftover of the old approach where we expanded all
hypertables at the beginning of the query. The current code expands all
hypertables when the "set pathlist" hook is called for the first
hypertable. This doesn't seem to lead to any problems, but this control
flow looks unexpected. Just let the Postgres enumerate all tables in
query normally, and in the hook, expand only the hypertable it is called
for.
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

-> Merge Join (actual rows=3.00 loops=1)
Merge Cond: (m2."time" = m1."time")
Join Filter: (m1.device_id = m2.device_id)
Join Filter: (m2.device_id = m1.device_id)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Caused by different equivalence member creation order, basically the reverse of changes in #9714.

@akuzm akuzm marked this pull request as ready for review June 22, 2026 08:19
@github-actions

Copy link
Copy Markdown

@melihmutlu, @natalya-aksman: please review this pull request.

Powered by pull-review

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.

4 participants