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

Update order_preservation.md #4159

Merged
merged 2 commits into from
Nov 27, 2024
Merged

Update order_preservation.md #4159

merged 2 commits into from
Nov 27, 2024

Conversation

soerenwolfers
Copy link
Contributor

@soerenwolfers soerenwolfers commented Nov 27, 2024

follow up to #4035 to explicitly answer misunderstandings exhibited in duckdb/duckdb#14755 and duckdb/duckdb#14941

By the way: Do you folks have recommendations for the common situation that one has a large table that's sorted by multiple columns (C1,...,Cn) and one wants to successively perform aggregations over Cn then Cn-1, ...? In that situation, there would be a trivial O(N) solution to doing each of the aggregations by hand, simply by checking group boundaries on the fly and producing aggregate values in an order preserving manner. Feels like the following duckdb snippet

SELECT  
  agg1(x)
FROM
(
  SELECT 
    agg2(x) AS x
  FROM 
  (
     ...
  )
  GROUP BY C2
)
GROUP BY C1


 would be inefficient in comparison?

@szarnyasg
Copy link
Collaborator

Thanks! I'll bring up the question with the team and get back to you.

@szarnyasg szarnyasg merged commit cf8d02c into duckdb:main Nov 27, 2024
4 checks passed
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.

2 participants