SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
S-55
General Rules for Similarity
Similarity checks work by comparing information stored in a program file at explicit 
compilation time with information current at recompilation time.
During an explicit recompilation, the SQL compiler uses similarity checks to 
differentiate between invalid and inoperable plans if you specify COMPILE 
INOPERABLE PLANS.
During an automatic recompilation, the SQL executor uses similarity checks to 
differentiate between invalid and inoperable plans if you specified CHECK 
INOPERABLE PLANS when you last explicitly compiled the program.
General Rules for Similarity
Only tables, protection views, and collations can be similar. A table can be similar to 
another table, a protection view can be similar to another protection view, and a 
collation can be similar to another collation. No object other than a table, protection 
view, or collation is ever considered similar to another object (even an object of the 
same type) for the purposes of a similarity check.
A table or protection view compared to a compile-time table or protection view in a 
similarity check must have its SIMILARITY CHECK option set to ENABLE.(When you 
create a table or view, the default is SIMILARITY CHECK DISABLE, but you can 
specify SIMILARITY CHECK ENABLE with the CREATE TABLE, CREATE VIEW, 
ALTER TABLE, or ALTER VIEW statements.)
The value of the SIMILARITY CHECK option for a table or protection view affects only 
that table or view, not views defined on that table or view.
Similarity Between Protection Views
A protection view referenced at execution time (or recompilation time) is similar to the 
protection view used at compilation time if the protection view referenced at execution 
time has the SIMILARITY CHECK option enabled and if both protection views
Have a similar underlying table
Project the same columns from the underlying table
Have the same column names
Have the same selection expression (determined by a binary comparison of the 
parsed, internal representation of the two selection expressions)
Similarity Between Tables
A table referenced at execution time (or recompilation time) is similar to the table used 
at compilation time if the table referenced at execution time has the SIMILARITY 
CHECK option enabled and if the tables are the same, except in these aspects:
These characteristics can differ:
Table names and table statistics










