net.sf.farrago.syslib
Class FarragoStatsUDR

java.lang.Object
  extended by net.sf.farrago.syslib.FarragoStatsUDR

public abstract class FarragoStatsUDR
extends Object

FarragoStatsUDR implements system procedures for manipulating Farrago statistics stored in the repository. The procedures are intended to be used for testing purposes, with the exception of get_row_count which may be used internally.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/syslib/FarragoStatsUDR.java#11 $
Author:
John Pham

Constructor Summary
FarragoStatsUDR()
           
 
Method Summary
static double get_cardinality(String catalog, String schema, String table, String column, String expression)
           
static long get_row_count(String catalogName, String schemaName, String tableName)
          Retrieves the row count for a table
static Double get_selectivity(String catalog, String schema, String table, String column, String expression)
           
private static RelStatColumnStatistics getColumnStats(String catalog, String schema, String table, String column, String expression)
           
static void set_column_histogram(String catalog, String schema, String table, String column, long distinctValues, int samplePercent, long sampleDistinctValues, int distributionType, String valueDigits)
          Creates a column histogram
static void set_page_count(String catalog, String schema, String index, long pageCount)
          Sets the page count for an index
static void set_row_count(String catalog, String schema, String table, long rowCount)
          Sets the row count for a table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FarragoStatsUDR

public FarragoStatsUDR()
Method Detail

set_row_count

public static void set_row_count(String catalog,
                                 String schema,
                                 String table,
                                 long rowCount)
                          throws SQLException
Sets the row count for a table

Throws:
SQLException

get_row_count

public static long get_row_count(String catalogName,
                                 String schemaName,
                                 String tableName)
                          throws SQLException
Retrieves the row count for a table

Throws:
SQLException

set_page_count

public static void set_page_count(String catalog,
                                  String schema,
                                  String index,
                                  long pageCount)
                           throws SQLException
Sets the page count for an index

Throws:
SQLException

set_column_histogram

public static void set_column_histogram(String catalog,
                                        String schema,
                                        String table,
                                        String column,
                                        long distinctValues,
                                        int samplePercent,
                                        long sampleDistinctValues,
                                        int distributionType,
                                        String valueDigits)
                                 throws SQLException
Creates a column histogram

Throws:
SQLException

get_cardinality

public static double get_cardinality(String catalog,
                                     String schema,
                                     String table,
                                     String column,
                                     String expression)
                              throws SQLException
Throws:
SQLException

get_selectivity

public static Double get_selectivity(String catalog,
                                     String schema,
                                     String table,
                                     String column,
                                     String expression)
                              throws SQLException
Throws:
SQLException

getColumnStats

private static RelStatColumnStatistics getColumnStats(String catalog,
                                                      String schema,
                                                      String table,
                                                      String column,
                                                      String expression)
                                               throws SQLException
Throws:
SQLException