A data engineer manages a materialized view in Amazon Redshift that includes a load_date column indicating when each row was inserted. The engineer must remove all rows from the materialized view to free up the most database storage. Which command reclaims the MOST storage?
Choose an answer
Tap an option to check your answer.
Correct answer: TRUNCATE materialized_view_name.
Why this is the answer
The TRUNCATE command is the most efficient way to remove all rows from a table or materialized view and reclaim storage in Amazon Redshift. It quickly deallocates the storage space used by the rows, effectively resetting the table to an empty state without scanning each row. DELETE FROM materializedviewname where 1=1 and DELETE FROM materializedviewname where loaddate<=currentdate both remove rows but do not immediately reclaim disk space. DELETE operations mark rows for deletion, but the space is only reclaimed later by a VACUUM operation. This makes them less efficient for immediate storage reclamation. VACUUM tablename where loaddate<=currentdate materializedview is syntactically incorrect for a VACUUM command and does not directly remove rows; VACUUM is used to reclaim space from deleted rows and sort tables.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed