If a statement contains references to multiple servers, or uses SQL features not supported by a remote server, the query is decomposed into simpler parts.
SELECT statements are broken down by removing portions that cannot be passed on and letting Sybase IQ perform the feature. For example, assume that a remote server cannot process the atan2() function in the following statement:
select acol, bcol, ccol where atan2(bcol,10) > 3 and ccol = 10
The statement sent to the remote server is converted to:
select acol, bcol, ccol where ccol = 10
Locally, Sybase IQ applies “where atan2(bcol,10) > 3" to the intermediate result set.
Sybase IQ processes joins involving remote tables using a nested loop algorithm. When two tables are joined, one table is selected to be the outer table. The outer table is scanned based on the WHERE conditions that apply to it. For every qualifying row found, the other table, known as the inner table is scanned to find a row that matches the join condition.
Since the cost of searching a remote table is usually much higher than a local table (due to network I/O), every effort is made to make the remote table the outermost table in the join.
When you join one or more remote tables to one or more local IQ tables, the part of the join that includes local tables is resolved locally, taking advantage of any join indexes that exist for the joined local columns. However, the part of the join that involves the remote tables does not use join indexes. As a result, you will likely notice slower responses to queries that include joins between local and remote tables.
You can issue an UPDATE or DELETE on a proxy table for a remote server that supports updates, as long as the query can be passed off completely.
For example, you can send the following update to a remote Sybase IQ 12.4.3 or higher database:
UPDATE t1 SET a = atan2(b, 10) WHERE b > 5
If Sybase IQ cannot pass off an UPDATE or DELETE completely, or if you send the query to a remote server that does not support updates, you receive an error. Sybase IQ does not support positioned updates on remote data.
An UPDATE or DELETE cannot be performed if an intermediate temporary table is required in Sybase IQ. This occurs in queries with ORDER BY and some queries with subqueries.