Slide 10
Slide 10 text
Alternative 2: Use of a function-based index that only indexes
the records with Sent=N
§ All records with Sent != N are not indexed (indexed expression = NULL)
§ The index value contains other attributes apart from the "Sent" column. This "Sent" column does not have to be part
of the index, as the index value != NULL already implicitly contains "Sent"=N.
§ Assuming that the two conditions for "Event-Type" are always fixed and the filter on "Event_Context" varies, then an
optimal function-based index would look like this
§ CREATE INDEX IX_Min ON Test(CASE WHEN Sent=‚N‘
AND Event_Type IN ('DeliveryCreated', 'DeliveryUpdated') THEN Event_Context END);
§ If the filter condition in the SQL is now formulated exactly like the indexed expression, the minimum function-based
index can be used for the query
§ Reduction of runtime to < 100µs (factor 20000++), index size = 64K (initial extent, 4% of previous size)
1 Buffer get in index / execution
§ For multi-column indices, all columns must have the NULL behavior in order to implement the size reduction