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

Reimplement datepart function to improve the performance #2195

Merged

Conversation

ParikshitSarode
Copy link
Contributor

@ParikshitSarode ParikshitSarode commented Jan 2, 2024

Description - Low performance with function sys. datepart_internal -- re-implement in C

  1. sys. datepart_internal function takes longer time in babelfish than expected
  2. The function is reimplemented in C for faster execution.
  3. Different wrapper functions are created according to the data type of the second argument in sys. datepart_internal.
  4. Additional tests are added covering all cases since previously incorrect query outputs were written in tests and logical errors were present in code
  5. Cherry-picked from BABEL_3_X_DEV to here and support for interval is added

Signed-off-by: Parikshit Sarode [email protected]

Issues Resolved

Task: BABEL-4302,BABEL-979, BABEL-4366 issues related to datepart, BABEL-4582 issues related to datepart and not cast

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Parikshit Sarode and others added 2 commits January 2, 2024 11:22
@ParikshitSarode ParikshitSarode deleted the Jira-4302-2X branch January 2, 2024 11:43
@ParikshitSarode ParikshitSarode restored the Jira-4302-2X branch January 2, 2024 11:51
@ParikshitSarode ParikshitSarode changed the base branch from BABEL_3_X_DEV to BABEL_2_X_DEV January 2, 2024 11:51
Parikshit Sarode and others added 3 commits January 2, 2024 11:56
This reverts commit 470e0db.
This reverts commit 4b85c4b.
PR implements fix for low performance with function sys. datepart_internal by re-implement in C

Signed-off-by: Parikshit Sarode <[email protected]>
Co-authored-by: Parikshit Sarode <[email protected]>
@ParikshitSarode ParikshitSarode changed the title Jira 4302 2 x datepart function reimplementation in BABEL_2_X_DEV Jan 2, 2024
@Deepesh125 Deepesh125 changed the title datepart function reimplementation in BABEL_2_X_DEV Reimplement datepart function to improve the performance Jan 3, 2024
@Deepesh125 Deepesh125 merged commit 5d80c2a into babelfish-for-postgresql:BABEL_2_X_DEV Jan 3, 2024
23 checks passed
@Deepesh125 Deepesh125 deleted the Jira-4302-2X branch January 3, 2024 11:22
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