refactor: partition tasks by range and by status in OLAP repository#6
Merged
abelanger5 merged 2 commits intomainfrom Feb 11, 2025
Merged
refactor: partition tasks by range and by status in OLAP repository#6abelanger5 merged 2 commits intomainfrom
abelanger5 merged 2 commits intomainfrom
Conversation
mrkaye97
approved these changes
Feb 11, 2025
Collaborator
mrkaye97
left a comment
There was a problem hiding this comment.
left a couple small questions, but lgtm 👍
Comment on lines
+58
to
+65
| format('ALTER TABLE %s SET ( | ||
| autovacuum_vacuum_scale_factor = ''0.1'', | ||
| autovacuum_analyze_scale_factor=''0.05'', | ||
| autovacuum_vacuum_threshold=''25'', | ||
| autovacuum_analyze_threshold=''25'', | ||
| autovacuum_vacuum_cost_delay=''10'', | ||
| autovacuum_vacuum_cost_limit=''1000'' | ||
| )', targetNameWithStatus); |
Collaborator
There was a problem hiding this comment.
if these magic numbers are special, might be useful for future us to have a comment here explaining how we decided on them
Comment on lines
+89
to
+93
| PERFORM create_v2_tasks_olap_partition_with_status(newTableName, 'QUEUED'); | ||
| PERFORM create_v2_tasks_olap_partition_with_status(newTableName, 'RUNNING'); | ||
| PERFORM create_v2_tasks_olap_partition_with_status(newTableName, 'COMPLETED'); | ||
| PERFORM create_v2_tasks_olap_partition_with_status(newTableName, 'CANCELLED'); | ||
| PERFORM create_v2_tasks_olap_partition_with_status(newTableName, 'FAILED'); |
Collaborator
There was a problem hiding this comment.
just calling out that this makes me nervous if we might add new enum values in the future - seems like the kind of thing we could easily forget to update. I don't really have any suggestions here though 🤷
| readable_status = n.readable_status | ||
| FROM new_rows n | ||
| WHERE t.id = n.id | ||
| AND t.inserted_at = n.inserted_at; |
Collaborator
There was a problem hiding this comment.
qq - do we need this second condition?
Author
There was a problem hiding this comment.
the primary key technically has it and the id isn't an identity column, it's a bigint which is sourced from the engine, so it might be necessary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Partitions tasks by range and status to get better query results when indexes can't be loaded into memory.
Type of change