Row Comparison Optimization

Optimize your row comparisons by fine-tuning various factors such as hash types, column comparison types, and row counts.

When you configure DA server for maximum performance, the bottleneck is often the database server itself; there is a limit to how fast a server can read, sort, and return your data. Use these guidelines to achieve optimal performance for row comparisons:
  • Configure non key columns to be compared using the row_hash option.
  • Configure row comparison using options in this order:
    1. database_hash.
    2. agent_hash and having a DA agent installed on a machine that shares a fast Ethernet connection with your database.

The database_hash option is the fastest row comparison choice, but if you have DA agent installation on the same machine as your DA server, the benefits of using the database_hash over agent_hash reduces. The key to ideal performance is minimizing the amount of data that is sent from your database to the DA server using the DA agent.

Row Comparison Considerations
Factor Explanation
Hash types

Sybase recommends you to select database_hash over agent_hash.

Hashing each database row is effectively a form of compression; hashed data is smaller, so there is less data to transfer and less data for comparison.

The database_hash option compresses the data at source database, and offers maximum performance when using remote DA agents and the local DA agent.

When you choose agent_hash, the DA agent must first receive each row in full before it can hash it, which typically takes longer.

Column compare options

Generally, choose the row_hash option over column_hash or literal.

row_hash creates a single hash value for all columns in the row. This is the least amount of data DA server can send and compare, while reliably identifying differences between two or more rows.

Choose column_hash over literal to see differences in individual columns. Each column configured with column_hash is assigned its own hash value. When using the hash option, the larger the datatype, the greater the advantage.

Row counts

When you have large tables that have no index, or your compareset defines a complex where constraint, initial select count (1) queries can take a long time to execute. In such cases, for your comparisons to complete more quickly, set enable_row_count to false.