Statistics for Non-equality constraint


Statistics for Non-equality constraint

Hi all,

        I would like to know to what level statistics on a column(s) is useful when the column(s) is used in a non-equality constraint (using <> operator)?

I believe the optimizer can derieve the record count that will qualify by using the following expression

 estimated number of records that will qualify =   estimated Table row count - average rows per value.

Also i would like to know why Index statistics from a Random Amp Sample  will not be used  if the predicate involves non-equality constraint on the Index.