Skip to Content

XSJS call prepare the statement on every call

We have complex logic in Procedure. When I run the procedure from HANA studio is take only 6 sec when executed for the first time and 3-4 sec when executed the second time. The statement is not prepared in the second call.

Second Time :

When I call the same procedure from XSJS it takes 20 seconds every time. ( I am using hdb loadProcedure to call the procedure from XSJS)

procedure = conn.loadProcedure("SCHEMA"."Proecedure");


I was able to find the find the reason for it, prepare of procedure call takes almost double of execution time and every time the Procedure is called from XSJS it is prepared.

My Questions would be:

  • Does prepare usually take higher time than the execution of the statement? When our logic is complex? I read in HANA developer guide about variable binding, our code follows the guidelines. We use
SELECT column1 from TABLE WHERE cloumn2 = :lv_one  
  • Instead of
SELECT column1 from TABLE WHERE cloumn2 =  1
  • How can I improve the prepare time?.
  • If prepare time is something I have to live with then how can I avoid statement being prepared every time it is called from XSJS?
firsttime.jpg (76.5 kB)
secondtime.jpg (75.1 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Feb 17, 2019 at 03:19 AM

    If the xsengine runs in its own process this is a known behavior. You could switch it to embedded mode in this case.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.