cancel
Showing results for 
Search instead for 
Did you mean: 

CDS view memory allocation failed error

former_member224444
Participant

Hello all,

I have a CDS view which in turn has many CDS views inside merged by union all. When i run this CDS view i get memory allocation failed error

"Database returned the SQL code 2.048. Error text: column store error: search table error: [9] Memory allocation failed;exception 1000002: Allocation failed ; $size$=410872064; $name$=Results; $type$=pool; $inuse_count$=387; $allocated_size$=271895727900; $alignment$=8; $failure_type$=STATEMENT_MEMORY_LIMIT; $failure_flag$= ,Exception in executor plan31326183@srv34051c2n2:31303 while executing pop 71"

Steps followed to check the error:

1) I ran each and every CDS view separately which are in union, that time it is not failing it is showing result for each and every cds view, but when running the base consumption cds view it fails

2) Even i checked the total record count, it is not more than 6000 records totally

3) I tried taking the trace file from index server of HANA db activating the "Plan trace" but still i am not able to see much info from that trace , it is not showing where exactly query failed

4) I tried checking the visualize plan of cds view by taking the planviz from ST12 trace , no luck in that also when clicking the “Execution Trace” it loads for sometime and again showing same memory allocation error.

Can anyone please let me know how to check which query exactly it fails or how to visualize this plan.

Thanks in advance

View Entire Topic
keremkoseoglu
Contributor
0 Kudos

I encountered the same error last week. It appears that the CDS engine reads excessive data during the execution of Join conditions. Fortunately, I was able to resolve the issue using SqlScript (AMDP).

Within my CDS, I had four tables - let's refer to them as A, B, C, and D. I knew that table B had a relatively small number of entries.

In my SqlScript code, I began by selecting filtered data from B, into a temporary table, say B_TMP. Then, I performed an inner join between :B_TMP and my CDS. Since implementing this solution, I haven't encountered any memory errors.