1.8
User Documentation for MADlib
quantile.sql_in File Reference

SQL function for Quantile. More...

Functions

float quantile_big (text table_name, text col_name, float quantile)
 Computes quantile. More...
 
float quantile (text table_name, text col_name, float quantile)
 Computes quantile. More...
 

Detailed Description

Date
January 2011
See also
For a brief introduction to quantiles, see the module description Quantile.

Function Documentation

float quantile ( text  table_name,
text  col_name,
float  quantile 
)
Parameters
table_namename of the table from which quantile is to be taken
col_namename of the column that is to be used for quantile calculation
quantiledesired quantile value \( \in (0,1) \)
Returns
The quantile value

This function computes the specified quantile value. It reads the name of the table, the specific column, and computes the quantile value based on the fraction specified as the third argument.

float quantile_big ( text  table_name,
text  col_name,
float  quantile 
)
Parameters
table_namename of the table from which quantile is to be taken
col_namename of the column that is to be used for quantile calculation
quantiledesired quantile value \( \in (0,1) \)
Returns
The quantile value

This function computes the specified quantile value. It reads the name of the table, the specific column, and computes the quantile value based on the fraction specified as the third argument. The functionality is the same as quantile except this implementation is designed to work more efficiently with large tables.