For equality and nonequality comparison of an encrypted column to a constant value, SAP ASE optimizes the column scan by encrypting the constant value once, rather than decrypting the encrypted column for each row of the table.
select sum(d.amount) from daily_xacts d where creditcard = '123-456-7890'
SAP ASE cannot use an index to perform a range search on an encrypted column; it must decrypt each row before performing data comparisons. If a query contains other predicates, SAP ASE selects the most efficient join order, which often leaves searches against encrypted columns until last, on the smallest data set.
select ss_num from taxpayers where zipcode like '02%' and agi_enc > 100000
The datatypes of the primary key and foreign key match according to the rules described above.
The encryption of the primary and foreign keys meets the key requirements for joining columns.