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

[SNOW-1844465] Avoid creating a CTE out of simple select start on top of a select entity #2713

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

sfc-gh-yzou
Copy link
Collaborator

@sfc-gh-yzou sfc-gh-yzou commented Dec 4, 2024

  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-1844465

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
    • I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: Thread-safe Developer Guidelines
  3. Please describe how your code solves the related issue.

The CTE optimization today will create a CTE out of a simple select * from TABLE, improve teh CTE by exclude such usage.

@sfc-gh-yzou sfc-gh-yzou added the NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md label Dec 5, 2024
@sfc-gh-yzou
Copy link
Collaborator Author

@sfc-gh-yzou sfc-gh-yzou marked this pull request as ready for review December 5, 2024 01:22
@sfc-gh-yzou sfc-gh-yzou requested review from a team as code owners December 5, 2024 01:22
# complexity_score = id_complexity_map[node_id]
repeated_count = len(id_node_map[node_id])
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# complexity_score = id_complexity_map[node_id]
repeated_count = len(id_node_map[node_id])
repeated_count = len(id_node_map[node_id])

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

Comment on lines 142 to 143
# id_complexity_map: Dict[str, int],
id_node_map: Dict[str, List["TreeNode"]],
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# id_complexity_map: Dict[str, int],
id_node_map: Dict[str, List["TreeNode"]],
id_node_map: Dict[str, List["TreeNode"]],

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

forgot to push the new change, removed

@sfc-gh-yzou sfc-gh-yzou force-pushed the yzou-SNOW-1844465-eliminate-uncessary-cte branch from 36792e4 to 85562f0 Compare December 5, 2024 18:49
Copy link
Contributor

@sfc-gh-helmeleegy sfc-gh-helmeleegy left a comment

Choose a reason for hiding this comment

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

LGTM

@sfc-gh-yzou sfc-gh-yzou force-pushed the yzou-SNOW-1844465-eliminate-uncessary-cte branch from 85562f0 to 2a460f3 Compare December 6, 2024 21:18
@sfc-gh-yzou sfc-gh-yzou merged commit 0c74413 into main Dec 6, 2024
39 of 42 checks passed
@sfc-gh-yzou sfc-gh-yzou deleted the yzou-SNOW-1844465-eliminate-uncessary-cte branch December 6, 2024 22:37
@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants