I understand that truncate lowers the high water mark on a table which allows space to be freed up and is generally quicker than a delete. However, if you have a temp table in a loop in which you are storing some scratch data each time you go through a loop and that scratch data is a constant size, lets size 500 rows, would it be better to delete the table so as to not have to acquire space each time through the loop. Also, I understand in this situation it may be better to use a nested table in PL/SQL but the question is still a valid one since I don't see it considered much in the discussions as delete retains space that you will end up needing to allocate repeatedly in a loop.
That would be a typical use case for using the REUSE STORAGE clause of the TRUNCATE command.
The TRUNCATE command, by default, does release all of the allocation but the REUSE clause prevents it from doing that.
Other typical uses of TRUNCATE myTAble REUSE STORAGE are in ETL processes where, as in your use case, a table is reloaded every day (or other time period) with about the same amount of data.
As you pointed out it is much quicker to retain the storage than to deallocate it and then reallocate it.
See the 'STORAGE Clauses' section of the TRUNCATE command in the SQL Language doc
STORAGEclauses let you determine what happens to the space freed by the truncated rows. The
STORAGEclause also apply to the space freed by the data deleted from associated indexes.
DROP STORAGE Specify
STORAGEto deallocate all space from the deleted rows from the table except the space allocated by the
MINEXTENTSparameter of the table or cluster. This space can subsequently be used by other objects in the tablespace. Oracle Database also sets the
NEXTstorage parameter to the size of the last extent removed from the segment in the truncation process. This is the default.
REUSE STORAGE Specify
STORAGEto retain the space from the deleted rows allocated to the table. Storage values are not reset to the values when the table or cluster was created. This space can subsequently be used only by new data in the table or cluster resulting from insert or update operations. This clause leaves storage parameters at their current settings.
If you have specified more than one free list for the object you are truncating, then the
STORAGEclause also removes any mapping of free lists to instances and resets the high-water mark to the beginning of the first extent.