Determine Whether Case or Trailing Space Settings Affect Query Performance

To determine if the TDV settings are affecting query performance, you can evaluate any filter nodes or the SQL underlying each FETCH node in the execution plan in Studio. Focus primarily on the WHERE clause or filter nodes.

For example, under certain conditions and with certain configuration parameter settings, TDV might apply RTRIM or UPPER functions to string comparisons in a WHERE clause. But this prevents the underlying system from using an index on that column, which affects query latency.

As another example, when a filter is applied at the TDV level, all rows must be returned from the underlying table, which could impact performance for large tables.

Review the following matrix to determine the possible impact of different case sensitivity and trailing spaces settings.

TDV Setting

Data Source Setting

TDV Query Behavior

case_sensitivity=true

case_sensitivity=true

No special action.

case_sensitivity=true

case_sensitivity=false

Pushes WHERE clause string comparison to data source, but applies the case sensitivity filter to the results returned.

case_sensitivity=false

case_sensitivity=true

Adds UPPER to both sides; mismatch is not necessarily a performance issue.

case_sensitivity=false

case_sensitivity=false

No special action.

ignore_trailing_spaces=true

ignore_trailing_spaces=true

No special action.

ignore_trailing_spaces=true

ignore_trailing_spaces=false

Adds RTRIM to both sides; mismatch is not necessarily a performance issue.

ignore_trailing_spaces=false

ignore_trailing_spaces=true

Pushes WHERE clause string comparison to data source, but applies the trailing spaces filter to the results returned.

ignore_trailing_spaces=false

ignore_trailing_spaces=false

No special action.

TDV reports settings matches and mismatches in the Resource Capabilities section display in the opened data source configuration window. Similar reports appear on the reintrospection and cache configuration displays.

Whenever possible, set TDV case and trailing space behavior to match the data sources. If this is not possible, the following effects might occur.

Case Sensitivity

Trailing Spaces

If TDV Server is set to be case sensitive and the data source is not case sensitive, the query is pushed to the data source, and then the case sensitivity filter is applied to the result set returned.

If you do not want the filter to be applied to the returned results, set Push Even if Case Sensitivity Mismatch to True.

If TDV Server is not set to ignore trailing spaces and the data source is set to ignore them, the query is pushed to the data source, and then TDV Server applies the trailing spaces filter to the result set returned.

If you do not want the filter to be applied to the returned results, set Push Even if Trailing Spaces Mismatch to True.

If TDV Server is not set to be case sensitive and the database is case sensitive, TDV Server adds an UPPER function to both values to ensure the data source performs a non-case-sensitive comparison. This should have little impact on performance.

To keep the UPPER function from being added to such queries, set Disable Case Sensitivity Correction to True.

If TDV Server is set to ignore trailing spaces and the database is not, you can force comparisons to show a match (so they can be pushed) by wrapping values in TRIM or RTRIM functions.

You can have TDV push unchanged comparison syntax to the data source by setting Push Even if Trailing Spaces Mismatch to True.