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