Skip to Main Content
IBM Data and AI Ideas Portal for Customers


This portal is to open public enhancement requests against products and services offered by the IBM Data & AI organization. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:


Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,


Post your ideas

Post ideas and requests to enhance a product or service. Take a look at ideas others have posted and upvote them if they matter to you,

  1. Post an idea

  2. Upvote ideas that matter most to you

  3. Get feedback from the IBM team to refine your idea


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

IBM Employees should enter Ideas at https://ideas.ibm.com


Status Not under consideration
Workspace Db2
Created by Guest
Created on Sep 26, 2017

Better performance of Java table routines

The existing Db2 interface for developing table functions in Java programming language is not designed for performance, because:
(a) It requires a separate native (JNI, e.g. Java-to-C) call for setting each field value for each output row
(b) It implies a separate C-to-Java call for each output row.
.
Java-to-C and C-to-Java calls are very expensive, and although it is not possible to completely avoid them, one of the important targets for performance tuning is to minimize the number of such calls.
.
The possible approach to minimize the expensive calls is to create the alternate to the current COM.ibm.db2.app.UDF base class, with the following improvements:
(1) Change all set(...) methods to non-native final, caching the data in some Java data structure (Map or ArrayList)
(2) Change all the get*() methods to non-native final, making the necessary data available in the Java data structures at the first call (e.g. if the data is not available, call the JNI method, otherwise use the cached copy).
(3) Add the method nextRow(), which will back the current row of values to some data structure (ByteArrayOutputStream?). If this structure exceeds the limit, push the pack of rows to private JNI method, which will send them for processing to the Db2 engine.
.
With those changes, small output tables in most cases will require only three expensive calls:
- the instantiation of UDF implementation class;
- actual call to the UDF implementation method;
- final call to the internal method returning the pre-packed set of rows.