Top Description Inners Fields Constructors Methods
org.h2.command.ddl

public Class Analyze

extends DefineCommand
Class Inheritance
Imports
java.util.Arrays, org.h2.command.CommandInterface, org.h2.engine.Constants, .Database, .Right, .SessionLocal, org.h2.index.Cursor, org.h2.result.Row, org.h2.schema.Schema, org.h2.table.Column, .Table, .TableType, org.h2.value.DataType, .Value

This class represents the statements ANALYZE and ANALYZE TABLE

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private int
sampleRows

The sample size.

private Table
table

used in ANALYZE TABLE...

Inherited from org.h2.command.ddl.DefineCommand:
transactional

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
analyzeTable(SessionLocal
the session
session
,
Table
the table
table
,
int
the number of sample rows
sample
,
boolean
whether the command was called by the user
manual
)

Analyze this table.

public int
getType()

Implements abstract org.h2.command.Prepared.getType.

Get the command type as defined in CommandInterface

public void
setTable(Table table)

public void
setTop(int top)

public long
update()

Overrides org.h2.command.Prepared.update.

Execute the statement.

Inherited from org.h2.command.ddl.DefineCommand:
isReadOnlyisRetryableisTransactionalqueryMetasetTransactional

Field Detail

sampleRowsback to summary
private int sampleRows

The sample size.

tableback to summary
private Table table

used in ANALYZE TABLE...

Constructor Detail

Analyzeback to summary
public Analyze(SessionLocal session)

Method Detail

analyzeTableback to summary
public static void analyzeTable(SessionLocal session, Table table, int sample, boolean manual)

Analyze this table.

Parameters
session:SessionLocal

the session

table:Table

the table

sample:int

the number of sample rows

manual:boolean

whether the command was called by the user

getTypeback to summary
public int getType()

Implements abstract org.h2.command.Prepared.getType.

Doc from org.h2.command.Prepared.getType.

Get the command type as defined in CommandInterface

Returns:int

the statement type

Annotations
@Override
setTableback to summary
public void setTable(Table table)
setTopback to summary
public void setTop(int top)
updateback to summary
public long update()

Overrides org.h2.command.Prepared.update.

Doc from org.h2.command.Prepared.update.

Execute the statement.

Returns:long

the update count

Annotations
@Override
org.h2.command.ddl back to summary

private final Class Analyze.SelectivityData

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private long
private int[]
private int
private int
size

The number of occupied slots, excluding the zero element (if any).

private boolean
zeroElement

Whether the zero element is present.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
private void
add(int element)

private int
pack-priv int
getSelectivity(long count)

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

distinctCountback to summary
private long distinctCount
elementsback to summary
private int[] elements
maxSizeback to summary
private int maxSize
sizeback to summary
private int size

The number of occupied slots, excluding the zero element (if any).

zeroElementback to summary
private boolean zeroElement

Whether the zero element is present.

Constructor Detail

SelectivityDataback to summary
pack-priv SelectivityData()

Method Detail

addback to summary
pack-priv void add(Value v)
addback to summary
private void add(int element)
currentSizeback to summary
private int currentSize()
getSelectivityback to summary
pack-priv int getSelectivity(long count)
rehashback to summary
private void rehash()