OR vs IN (solution)

Which one is faster ?
SELECT *
  FROM tab
 WHERE x='YES' OR x='NO' OR x='PERHAPS' OR x='MAYBE'; 
or
SELECT *
  FROM tab
 WHERE x IN ('YES','NO','PERHAPS','MAYBE'); 

SELECT commands are not "thrown" to optimizer directly as string, but are first compiled into BLR (Binary Language Representation).
BLR representations of the above commands are identical, and so the optimizer has no chance to distinguish them. Thus the answer shoud be How to look at BLR ? There are many ways, e.g. using QLI tool (use SET BLR command), looking at output generated by GPRE, or using these SELECT commands in SP, trigger or view and looking at their compiled versions into system tables (RDB$PROCEDURE_BLR field in RDB$PROCEDURES table etc.).

Note: To be more precise, IB5 generated identical BLRs. Due to changes in IB6, parts of generated BLR code can be slightly reordered, which should not however affect the optimizer. These two clauses do generate identical BLR in IB6/FB:
"WHERE ((x='YES' OR x='NO') OR x='PERHAPS') OR x='MAYBE'"
"WHERE x IN ('YES','NO','PERHAPS','MAYBE')"


Ivan Prenosil (2002)