babelfish_extensions icon indicating copy to clipboard operation
babelfish_extensions copied to clipboard

Jira babel 3756

Open ParikshitSarode opened this issue 2 years ago • 0 comments

Description

SPI_plan_get_cached_plan call inside exec_stmt_exexsql leads to performance overhead

  1. SPI_plan_get_cached_plan call inside exec_stmt_exexsql leads to performance overhead, so calls to the function are reduced. SPI_plan_get_cached_plan is only called for the queries which needed the cachedPLan
  2. The SPI_plan_get_cached_plan is only called for queries with OUTPUT clause, and with TRIGGERS on queries
  3. Reducing the calls leads to a query time execution of 1.6% on average for the queries as other bottlenecks were observed when tried to optimise further.
  4. Further optimisation regarding the simple expressions is done in Jira babel 3755 together with this a performance improvement of around 11% is noticed for simple queries(queries that do not access a database relation)

Issues Resolved

SPI_plan_get_cached_plan calls reduced and called only when necessary

Check List

  • [x] 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.

ParikshitSarode avatar Oct 08 '23 10:10 ParikshitSarode