In Oracle Database, what is meant by WATER MARK on a table segment, and what is the significance of the High Water Mark HWM?

Difficulty: Medium

Correct Answer: The High Water Mark indicates the highest point in a table segment up to which blocks have ever been used, and it is used by Oracle to determine how far full table scans must read

Explanation:


Introduction / Context:
Oracle Database stores table data in segments composed of data blocks. Over time, as rows are inserted and deleted, some blocks become empty while others remain partially used. To manage full table scans efficiently, Oracle maintains a High Water Mark within each segment. Understanding this concept is important for performance tuning and space management, because it explains why full table scans sometimes take longer even when many rows have been deleted. This question asks you to define the High Water Mark and describe its significance.


Given Data / Assumptions:

  • A table segment occupies a set of Oracle data blocks on disk.
  • As data is inserted, more blocks are formatted and used.
  • When rows are deleted, blocks may become empty but are still part of the segment.
  • Oracle must know how far to read during operations such as full table scans.


Concept / Approach:
The High Water Mark is a boundary within a table or index segment that marks the highest block that has ever been allocated and used for that segment. During a full table scan, Oracle reads all blocks from the beginning of the segment up to the High Water Mark, even if some blocks above currently contain no rows. This ensures that all possible rows are seen but can also lead to extra I/O if many blocks are empty. Certain maintenance operations, such as shrinking a segment or moving a table, can lower the High Water Mark by releasing unused space. The correct option must mention this highest used point and its role in full table scans.


Step-by-Step Solution:
Step 1: Recall that WATER MARK in this context refers to a boundary marker inside the segment, not to user labels or logs. Step 2: Understand that the High Water Mark records the highest block address that has ever contained data for the segment. Step 3: Know that during a full table scan Oracle reads from the segment start up to the High Water Mark to ensure it does not miss any rows. Step 4: Evaluate option a, which describes exactly this behaviour and explains that the High Water Mark determines how far full scans must read. Step 5: Compare with other options that incorrectly describe the High Water Mark as a row limit, security label, or log file.


Verification / Alternative check:
Database administrators often observe that full table scans remain expensive after massive deletes because the High Water Mark has not moved down. Only segment shrink or move operations can reduce it. Performance tuning guides also discuss how the High Water Mark influences scan cost and why newly created tables with low High Water Marks scan faster. These practical observations support the explanation given in option a and confirm its correctness.


Why Other Options Are Wrong:
Option b suggests that the High Water Mark is a configurable row limit, which is incorrect; Oracle does not use the High Water Mark to enforce row count limits. Option c claims it is a user defined security label, but Oracle label based security uses separate mechanisms. Option d mislabels it as a log file storing Data Manipulation Language statements; logging and redo information are handled by different components of Oracle, not by the High Water Mark.


Common Pitfalls:
A common mistake is assuming that deleting rows automatically frees space and reduces scan cost. In reality, the High Water Mark does not move down on simple deletes, so full scans still read blocks that may now be empty. Another pitfall is ignoring the impact of High Water Mark on performance when designing maintenance tasks. Regular monitoring and appropriate use of segment shrink or reorganisations can help keep High Water Marks aligned with actual data usage.


Final Answer:
In Oracle, the High Water Mark indicates the highest point in a table segment up to which blocks have ever been used, and it is used by the database engine to determine how far full table scans must read.

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion