exam questions

Exam AWS Certified Data Engineer - Associate DEA-C01 All Questions

View all questions & answers for the AWS Certified Data Engineer - Associate DEA-C01 exam

Exam AWS Certified Data Engineer - Associate DEA-C01 topic 1 question 127 discussion

A data engineer maintains a materialized view that is based on an Amazon Redshift database. The view has a column named load_date that stores the date when each row was loaded.

The data engineer needs to reclaim database storage space by deleting all the rows from the materialized view.

Which command will reclaim the MOST database storage space?

  • A. DELETE FROM materialized_view_name where 1=1
  • B. TRUNCATE materialized_view_name
  • C. VACUUM table_name where load_date<=current_date
    materializedview
  • D. DELETE FROM materialized_view_name where load_date<=current_date
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
bad1ccc
1 month ago
Selected Answer: B
When you TRUNCATE a materialized view in Amazon Redshift, it removes all rows from the view and reclaims the most storage space because the operation does not log individual row deletions. This is far more efficient in terms of both time and space than a DELETE operation.
upvoted 1 times
...
JimOGrady
2 months ago
Selected Answer: B
the key is "reclaim database storage space" Delete does not reclaim disk space
upvoted 2 times
...
sravanscr
3 months ago
Selected Answer: B
in AWS Redshift, you can use the "TRUNCATE" command to delete all rows from a materialized view, effectively "truncating" it, especially when the materialized view is configured for streaming ingestion; this is a faster way to clear the data compared to a "DELETE" statement.
upvoted 1 times
...
YUICH
3 months, 1 week ago
Selected Answer: A
(B) TRUNCATE is invalid for materialized views, so it is excluded. In actual operations, to most effectively reuse storage, you need to delete all rows with a DELETE statement and then run VACUUM, as shown in (A) or (D). If you want to delete everything, option (A) is the most straightforward approach.
upvoted 2 times
...
A_E_M
3 months, 2 weeks ago
Selected Answer: A
Why this is the best option: Efficiency: By using "WHERE 1=1", the database doesn't need to iterate through each row individually to check a specific condition, resulting in faster deletion of all data. Storage reclamation: Deleting all rows using this method will free up the most storage space within the materialized view. Important Considerations: TRUNCATE vs DELETE: While "TRUNCATE" can also be used to remove all data from a table, it is not recommended for materialized views in Redshift as it might not always reclaim all the storage space effectively. VACUUM command: "VACUUM" is used to reclaim space within a table after deletions, but it's not necessary when deleting all rows using "DELETE FROM ... WHERE 1=1;" as the entire table will be emptied.
upvoted 3 times
...
AgboolaKun
5 months, 3 weeks ago
Selected Answer: B
B is the correct answer. Here is why: TRUNCATE is the most efficient way to remove all rows from a table or materialized view in Amazon Redshift. It's faster than DELETE and immediately reclaims disk space. TRUNCATE removes all rows in a table without scanning them individually. This makes it much faster than DELETE operations, especially for large tables. TRUNCATE automatically performs a VACUUM operation, which sorts the table and reclaims space. TRUNCATE resets any auto-increment columns.
upvoted 1 times
...
Parandhaman_Margan
6 months, 1 week ago
Answer:B TRUNCATE Command: The TRUNCATE command is the most efficient way to delete all rows from a table or materialized view. It does not scan the table, does not generate individual row delete actions, and effectively frees up space immediately by removing all data at once. It also resets any identity columns, if applicable.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago