Skip to Content
Jul 19, 2018 at 10:32 PM

Graphscript in SAP HANA - slow performance when result has many rows



I'm trying to use HANA Graphscript capabilities in my current project. Recently I've bumped into performance degradation and wonder if somebody has a solution.

I'm doing a BFS traverse on my graph using standard BFS feature of HANA SP03, I got GraphScript procedure for this. My graph is pretty dense and the result can easily go to a couple or several thousands of rows.

I'm returning a TABLE type and use the following statement, pretty much the simplest thing possible as per tutorial:

res = SELECT :e."TARGET", :e."CATEGORY_ID" FOREACH e IN :selectedEdges;

where selectedEdges is a Multiset of graph Edges that I've filtered before.

However, it takes up to 10 seconds in my environment to prepare that result, which is obviously not acceptable. I've tested running time of other parts combined and it's up to tens of milliseconds. In case when result collection has only several hundreds of records running time became moderate - 100-200 miliseconds.

Is there another faster way of returning thousands of data from the graph script? I have a lot of liberty in my implementation, so I'll consider any approach that works. What I need in OUT parameter is a collection of some attributes of vertexes and of edges.

With best regards,