Quantcast
Channel: SCN : Unanswered Discussions - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 4343

INSERT INTO TABLE (SELECT ...) Poor Performance

$
0
0

Hi folks,

 

I have another performance issue on HANA. I have a query Insert Into table (Select...) as follows:

 

insert into "SYSTEM"."SIMILARITYSCORES"
(select T."id", T."text_data", T.TOTAL_TERM_COUNT, T.SCORE
 FROM TM_GET_RELATED_DOCUMENTS (
 DOCUMENT 'some text here to find its related documents'
 SEARCH "text_data" FROM "SYSTEM"."TABLE_TEST"
 RETURN
 TOP 100000 
 "id", "text_data"
 ) AS T);

This query takes 7-8 minutes to be completed. However, if I just execute select statement, it finishes instantly. Select part returns about 750 rows, so is it normal to take 7-8 minutes to insert them into another table? By the way, there is no primary key nor index on SIMILARITYSCORES table.

 

I tried to replaced insert into part with create table as follows, but nothing changed with performance

 

create table "SYSTEM"."SIMILARITYSCORES" AS
(select T."id" as "id", T."text_data" as "text", T.TOTAL_TERM_COUNT as "TOTAL_TERM_COUNT", T.SCORE as "SCORE"
 FROM TM_GET_RELATED_DOCUMENTS (
 DOCUMENT 'some text here to find its relevant documents '
 SEARCH "text_data" FROM "SYSTEM"."TABLE_TEST"
 RETURN
 TOP 100000
 "id", "text_data"
 ) AS T)

I want to find a way to improve its performance, maybe you can help me with this.

 

Note: TM_GET_RELATED_DOCUMENTS is a function which is coming from text mining.

 

Thanks in advance,

Inanc


Viewing all articles
Browse latest Browse all 4343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>