• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

babelfish-for-postgresql / babelfish_extensions / 9834285708
76%
BABEL_5_X_DEV: 77%

Build:
Build:
LAST BUILD BRANCH: fix_script_injection
DEFAULT BRANCH: BABEL_5_X_DEV
Ran 08 Jul 2024 06:35AM UTC
Jobs 1
Files 114
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Jul 2024 05:55AM UTC coverage: 73.182% (-0.02%) from 73.197%
9834285708

push

github

web-flow
Optimise lookup for babelfish_function_ext catalog (#2677)

Extended catalog `sys.babelfish_function_ext` currently uses as its key the schema name plus the function signature. This dates back to the time when Babelfish did not yet block duplicate functions with different signatures, but that is blocked now.
When doing a lookup for this catalog, the function signature must first be constructed in `get_pltsql_function_signature_internal()`. This uses a GUC to ensure that non-system names are double-quoted (required for the lookup), which appears to be a relatively expensive operation.

Since Babelfish no longer supports function overloading, we can perform a lookup directly using the schema name + function name. This requires an updated primary key on the catalog as (funcname + nspname + funcsignature). With this, we now will first perform lookup with partial key (funcname + nspname) and return the tuple if there is a unique match which will save us from constructing function signature. In case of multiple matches, we will then perform the lookup using complete key (funcname + nspname + funcsignature).

This optimization improves the performance which was previously impacted by WITH RECOMPILE which was added as part of https://github.com/babelfish-for-postgresql/babelfish_extensions/pull/2563 . It introduced a lookup into babelfish_function_ext catalog using get_bbf_function_tuple_from_proctuple which performs the signature-based lookup for every stored procedure call.

### Performance data
Below table shows the time taken (in ms) for 100000 executions of the a procedure,  randomly picking a procedure each time from 10000 existing procedures in the database:

| S.N. | Scenario                           | Sample 1 | Sample 2 | Sample 3  | Sample 4 | Sample 5 | Sample 6 | Average  |
| :--- | :----------------------- | :-------- | :-------- | :--------- | :-------- | :-------- | :-------- | :-------- |
| 1      | Without current changes | 3478... (continued)

35 of 45 new or added lines in 3 files covered. (77.78%)

6 existing lines in 1 file now uncovered.

42835 of 58532 relevant lines covered (73.18%)

110501.41 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
60.92
0.0% contrib/babelfishpg_tsql/src/pltsql_ruleutils.c
2
79.67
-0.04% contrib/babelfishpg_tsql/src/hooks.c
7
85.51
-0.48% contrib/babelfishpg_tsql/src/catalog.c

Uncovered Existing Lines

Lines Coverage ∆ File
6
85.51
-0.48% contrib/babelfishpg_tsql/src/catalog.c
Jobs
ID Job ID Ran Files Coverage
1 9834285708.1 08 Jul 2024 06:35AM UTC 114
73.18
GitHub Action Run
Source Files on build 9834285708
  • Tree
  • List 114
  • Changed 39
  • Source Changed 4
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #9834285708
  • 1a0568cb on github
  • Prev Build on BABEL_4_X_DEV (#9766489889)
  • Next Build on BABEL_4_X_DEV (#9842798170)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc