I have 100 lacs (1 crore) ' s of records in my temp-table. I wanted to empty my temp-table which one is faster and why
for each tt:
delete tt.
end.
or
Empty temp-table tt.
I am using open edge 11.4.
I have 100 lacs (1 crore) ' s of records in my temp-table. I wanted to empty my temp-table which one is faster and why
for each tt:
delete tt.
end.
or
Empty temp-table tt.
I am using open edge 11.4.
Flag this post as spam/abuse.
No I was not actually copying the DB records into temp-table. I was taking those records from a text file.
No I was not actually copying the DB records into temp-table. I was taking those records from a text file.
Flag this post as spam/abuse.
I have 100 lacs (1 crore) ' s of records in my temp-table. I wanted to empty my temp-table which one is faster and why
for each tt:
delete tt.
end.
or
Empty temp-table tt.
I am using open edge 11.4.
Flag this post as spam/abuse.
Flag this post as spam/abuse.
DELETE deletes the records individually whereas EMPTY TEMP-TABLE deletes all records in the temp-table as a unit. Hence, EMPTY TEMP-TABLE should be faster.
My database files are growing till 2gb. but I am not a database expert. so not having much knowledge about database files. like d1,d2...etc.............I am just asking it for programming purpose.
Returning/deleting (if class, persistent procedure) the procedure that defines the temp-table is faster.
EMPTY TEMP-TABLE when there is no active transaction, or anytime for a NO-UNDO temp-table is just as fast. Otherwise, it's comparable to FOR EACH: DELETE.
You almost never need to have that many records in a temp-table at one time. If you do then most likely something is wrong. Worst case when importing from a file you should be batching the temp-table load and then writing to the DB and emptying the temp-table.
All that being said.... If you make sure your -Bt is set high enough to keep all of the temp-table records in memory and use EMPTY TEMP-TABLE it should happen pretty fast.