Skip to content

Commit

Permalink
datepart function reimplementation (#1959)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
2 people authored and shardgupta committed Jan 9, 2024
1 parent 4eee4f6 commit 4ba78ca
Show file tree
Hide file tree
Showing 12 changed files with 9,631 additions and 214 deletions.
1 change: 1 addition & 0 deletions contrib/babelfishpg_common/src/babelfishpg_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ get_common_utility_plugin(void)
common_utility_plugin_var.datetime_in_str = &datetime_in_str;
common_utility_plugin_var.datetime2sqlvariant = &datetime2sqlvariant;
common_utility_plugin_var.timestamp_datetimeoffset = &timestamp_datetimeoffset;
common_utility_plugin_var.datetimeoffset_timestamp = &datetimeoffset_timestamp;
common_utility_plugin_var.tinyint2sqlvariant = &tinyint2sqlvariant;
common_utility_plugin_var.translate_pg_type_to_tsql = &translate_pg_type_to_tsql;
common_utility_plugin_var.get_tsql_datatype_oid = &get_tsql_datatype_oid;
Expand Down
1 change: 1 addition & 0 deletions contrib/babelfishpg_common/src/babelfishpg_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ typedef struct common_utility_plugin
Datum (*datetime_in_str) (char *str, Node *escontext);
Datum (*datetime2sqlvariant) (PG_FUNCTION_ARGS);
Datum (*timestamp_datetimeoffset) (PG_FUNCTION_ARGS);
Datum (*datetimeoffset_timestamp) (PG_FUNCTION_ARGS);
Datum (*tinyint2sqlvariant) (PG_FUNCTION_ARGS);
Datum (*translate_pg_type_to_tsql) (PG_FUNCTION_ARGS);
Oid (*get_tsql_datatype_oid) (char *type_name);
Expand Down
1 change: 1 addition & 0 deletions contrib/babelfishpg_common/src/datetimeoffset.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ extern void CheckSmalldatetimeRange(const Timestamp time, Node *escontext);
extern void CheckDatetimeRange(const Timestamp time, Node *escontext);
extern void CheckDatetime2Range(const Timestamp time, Node *escontext);
extern Datum timestamp_datetimeoffset(PG_FUNCTION_ARGS);
extern Datum datetimeoffset_timestamp(PG_FUNCTION_ARGS);
typedef struct tsql_datetimeoffset
{
int64 tsql_ts;
Expand Down
Loading

0 comments on commit 4ba78ca

Please sign in to comment.