SELECT Statement WITHIN Clause

[This is preliminary documentation and subject to change.]

The WITHIN clause is used to reduce the number of notifications that are sent for events that occur with great frequency. The WITHIN clause is also used by CIMOM to simulate events when no event provider exists that can generate notifications for a particular class.

The WITHIN clause appears immediately prior to the WHERE clause:

select <property_list> from <class> WITHIN interval <where_clause>
 

The interval value that follows the WITHIN keyword is the maximum amount of time that can pass before a notification must be sent representing the specified event class. This interval is a floating-point number and can be fractional to deal with values smaller than one second. However, it is recommended that the interval represent a number of seconds rather than an extremely small value such as 0.001. Specifying too small a value can cause CIMOM to reject the statement as invalid.

For example, this query requests notification of instance modification events for the Win32_LogicalDisk class. However, only one notification is sent every 10 seconds, regardless of how many events actually occur in that timeframe.

select * from __InstanceModificationEvent within 10.0 
    where TargetInstance isa "Win32_LogicalDisk
 

If the query requests notification of an intrinsic event for a class that has is unsupported by any of the registered event providers, CIMOM generates the notifications. CIMOM polls instances of the class according to the interval specified in the WITHIN clause looking for changes.