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

modifying sql to do a join with the pg table after creating a temp table #146

Merged
merged 4 commits into from
May 2, 2024

Conversation

DevanathanSabapathy1
Copy link
Contributor

@DevanathanSabapathy1 DevanathanSabapathy1 commented May 1, 2024

Issue #, if available:
The issue is the query we currently have for getting replay stats uses pg tables and sys_views. The problem is having both these tables generates an execution plan that runs on Leader Node and the Compute Nodes. This causes a problem in Redshift and throws an error in some Redshift clusters

Description of changes:
To fix this issue, I removed the pg tables that are Leader Node only tables. This way we have an execution plan that runs only on the Compute nodes.

To verify that the new query generates a execution plan that does not involve Leader Node and Compute Node, I ran both the old query and the new query and verified that the new query does not have a LN step compared to the old query that will have an LN step in the execution plan.

Copy link

@Brandon-Schur Brandon-Schur left a comment

Choose a reason for hiding this comment

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

LGTM

@DevanathanSabapathy1 DevanathanSabapathy1 merged commit f8832a0 into main May 2, 2024
2 checks passed
@DevanathanSabapathy1 DevanathanSabapathy1 changed the title modifying sql by removing pg tables in the query modifying sql to do a join with the pg table after creating a temp table May 2, 2024
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