This is a really interesting discussion and I'm curious if you can use a CASE instead of DECODE in the virtual column you created? (DECODE seems more expensive than CASE if I remember correctly in normal SQL) Chris -----Original Message----- From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Mark W. Farnham Sent: Thursday, July 11, 2013 10:37 AM To: IIotzov@xxxxxxxxxxxxxxx; Martin.Klier@xxxxxxxxxx; oracle-l@xxxxxxxxxxxxx Subject: RE: How to calculate cardinality for inequality in WHERE Iotzov: That is a slick idea. Martin: If it were worthwhile in your situation to be extremely fast at finding just the relevant rows, then: alter table junk23 add (id1_lt_id2 number as (decode(id1-id2,-1,id1-id2,0,null,null))); -- //www.freelists.org/webpage/oracle-l