lib/limits/estimates.js
function numberOfDistinctValues(node, context, columnName, callback) {
    var sql = countDistinctValuesTemplate({
        source: node.sql(),
        column: columnName
    });
    context.runSQL(sql, function(err, resultSet){
        var number = null;
        if (!err) {
            number = resultSet.rows[0].count_distict_values;
        }
        return callback(err, number);
    });
}
function numberOfDistinctValues(node, context, columnName, callback) {
    var sql = countDistinctValuesTemplate({
        source: node.sql(),
        column: columnName
    });
    context.runSQL(sql, function(err, resultSet){
        var number = null;
        if (!err) {
            number = resultSet.rows[0].count_distict_values;
        }
        return callback(err, number);
    });
}
function numberOfDistinctValues ( node , context , columnName , callback ) { var sql = countDistinctValuesTemplate ( { source : node . sql ( ) , column : columnName } ) ; context . runSQL ( sql , function ( err , resultSet ) { var number = null ; if ( ! err ) { number = resultSet . rows [ 0 ] . count_distict_values ; } return callback ( err , number ) ; } ) ; }
Estimate number of distict values of a column in a node's query.
Estimate number of distict values of a column in a node s query .