Skip to content

Improvements to disabling spill for distinct and order by aggregations#16564

Merged
rschlussel merged 4 commits intoprestodb:masterfrom
rschlussel:disable-distinct-spill-fixes
Aug 6, 2021
Merged

Improvements to disabling spill for distinct and order by aggregations#16564
rschlussel merged 4 commits intoprestodb:masterfrom
rschlussel:disable-distinct-spill-fixes

Conversation

@rschlussel
Copy link
Contributor

@rschlussel rschlussel commented Aug 4, 2021

This PR fixes the test for ensuring that we don't spill with distinct/order by spill enabled and improves how we are disabling spill.

Test plan - unit tests

== RELEASE NOTES ==

General Changes
* Add session property ``query_max_revocable_memory_per_node`` to override existing configuration property ``experimental.max-revocable-memory-per-node``

@rschlussel rschlussel changed the title Disable distinct spill fixes Improvements to disabling spill for distinct and order by aggregations Aug 4, 2021
@rschlussel rschlussel requested a review from a team August 4, 2021 22:52
Copy link
Contributor

Choose a reason for hiding this comment

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

MAX_REVOCABLE_MEMORY_PER_NODE --> QUERY_MAX_REVOCABLE_MEMORY_PER_NODE

Comment on lines 393 to 394
Copy link
Contributor

@pgupta2 pgupta2 Aug 5, 2021

Choose a reason for hiding this comment

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

Lets also remove hasDistinct() and hasOrderBy() methods in this class.

Simplify so that everything is using the same source to check if spill
is enabled.
@rschlussel rschlussel force-pushed the disable-distinct-spill-fixes branch from 3af3bda to cf54ee4 Compare August 5, 2021 13:22
Add session property query_max_revocable_memory_per_node for the config
property experimental.max-revocable-memory-per-node
spill_enabled is already set by config.  Don't need session property
also.
The session property we were using before to ensure spill wasn't being
run wasn't actually enforcing a limit.  Additionally, the distinct
aggregation test wasn't spilling in the aggregation even with spill
enabled because the aggregation would finish before spilling started.
Finally, we needed to remove the final order by from the queries to
prevent failures due to spilling the order by operator.
@rschlussel rschlussel force-pushed the disable-distinct-spill-fixes branch from cf54ee4 to fc88a8e Compare August 5, 2021 14:06
@rschlussel
Copy link
Contributor Author

Thanks @pgupta2 for review. addressed your comments.

@rschlussel rschlussel requested a review from arhimondr August 5, 2021 19:34
@rschlussel rschlussel merged commit 1aeef5b into prestodb:master Aug 6, 2021
@varungajjala varungajjala mentioned this pull request Aug 16, 2021
3 tasks
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.

3 participants