on 12-15-2015 3:19 PM
I have a question about optimizing for hana db.
In old days we would remove rows from a big table like this:
DO.
EXEC SQL.
delete from table
where mandt = :sy-mandt
and rownum <= :c_block_size
ENDEXC.
IF sy-dbcnt EQ 0.
EXIT.
ENDIF.
CALL FUNCTION 'DB_COMMIT'.
ENDDO.
Because HANA is a in-memory DB can we just do this:
delete from table.
That should be working great right ?
Hi Shreyas,
If you know what data has to be deleted then you can write the procedure with delete statement with proper WHERE condition.
Whenever you call the procedure, records meeting the criteria will be deleted.
First you try this in development environment and if you are happy with the results then only try in other environments.
Regards
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
All records must be deleted. The where is only done for client dependency but the row_num is just s that the DB wouldn't hang/throw errors if you delete 1 million records at once thats why its in a DO statement.
This is not possible in HANA and i was also thinking because HANA DB is so fast do we still need to do it like this or can we just remove 1 million rows at once ?
User | Count |
---|---|
71 | |
26 | |
10 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.