Skip to content

fix cross-shard ORDER BY on non-projected columns - #1517

Open
murex971 wants to merge 6 commits into
pgdogdev:mainfrom
murex971:fix-projection
Open

fix cross-shard ORDER BY on non-projected columns#1517
murex971 wants to merge 6 commits into
pgdogdev:mainfrom
murex971:fix-projection

Conversation

@murex971

Copy link
Copy Markdown
Contributor

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

mut message: Message,
) -> Result<(), Error> {
if !self.backend.is_multishard() {
drop_projected_columns(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Aren't we calling drop_columns twice now? Once in multi shard binding, and once here, so twice for multi-shard queries and once for direct-to-shard queries.

}
}

fn drop_projected_columns(

@levkk levkk Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would probably push this concern into the connection binding (e.g.. read method). The architecture is as such that piece of code handles the cross-shard/direct-to-shard message manipulation. The query engine doesn't actually know whether it's talking to one or more servers, so this leaks it here.

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.

[Query Engine] ORDER BY on non-projected column can produce incorrect cross-shard ordering

2 participants