ttOptEstimateStats用法
来源:互联网 发布:电信iptv机顶盒装软件 编辑:程序博客网 时间:2024/05/17 00:52
ttOptEstimateStats
Description
This procedure updates the statistics for the specified table. This procedure estimates statistics by looking at a random sample of the rows in the specified table(s). The sample size is the number of rows specified (if sampleStr
has the form '
n
ROWS'
) or a percentage of the total number of rows (if sampleStr
has the form '
p
PERCENT
'
).
Required privilege
This procedure requires no privilege for the table owner. This procedure requires no privilege if tblName
is not specified, because the procedure operates on the current user's tables if tblName
is not specified.This procedure requires the ALTER ANY TABLE
privilege if user is not the table owner.
Syntax
ttOptEstimateStats('tblName', invalidate, 'sampleStr')
Parameters
ttOptEstimateStats
has these parameters:
tblName
TT_CHAR(61)
Name of an application table. Can include table owner. If tblName
is the empty string, statistics are estimated for all the current user's tables in the database. Using a synonym to specify a table name is not supported.
invalidate
TT_INTEGER
0 (no) or 1 (yes). If invalidate
is 1, all commands that reference the affected tables are automatically prepared again when re-executed, including commands prepared by other users. If invalidate
is 0, the statistics are not considered to have been modified and existing commands are not reprepared. The invalidate
parameter is optional and defaults to 0.sampleStr
TT_VARCHAR (255) NOT NULL
String of the form 'n
ROWS', where n
is an INTEGER
greater than zero; or 'p
PERCENT', where p
is a floating point number between 0.0 and 100.0 inclusive.Result set
ttOptEstimateStats
returns no results.
Examples
CALL ttOptEstimateStats ( 'ACCTS', 1, '5 PERCENT' );CALL ttOptEstimateStats ( 'ACCTS', 1, '75 ROWS' );
Notes
The TimesTen statistics include the number of rows in each table, the number of unique values in each column, and the minimum and maximum values in each column. TimesTen assumes a uniform distribution of column values.
This procedure only runs faster than ttOptUpdateStats
when you sample less than 50 percent of the rows in the table.
Estimates are not computed on columns that are longer than 2,048 bytes, and statistics for these columns are not updated. To update statistics on columns longer than 2,048 bytes, use the ttOptUpdateStats
built-in procedure. (For varying length columns, this procedure updates statistics only if the column has a maximum length of 2,048 bytes or less.)
If a very small value is chosen for the sampleStr
parameter, this procedure runs quickly but may result in suboptimal execution plans. For "good" distributions of data, a 10 percent selection is a good choice for computing statistics quickly without sacrificing plan accuracy. If the number of rows specified is sufficiently large or the table in question is sufficiently small, to improve performance TimesTen computes exact statistics anyway on all columns that have a length of 2,048 bytes or less. For example, the only difference between
ttOptEstimateStats ('ACCTS', 1, '100 PERCENT' )
and
ttOptUpdateStats( 'ACCTS', 1 )
is that the former does not compute statistics for long columns.
The statistics are stored in the TBL_STATS
and COL_STATS
system tables.
For performance reasons, TimesTen does not hold a lock on tables or rows when computing statistics. However, computing statistics can still slow performance. Estimating statistics generally provides better performance than computing exact statistics.
- ttOptEstimateStats用法
- 用法
- ,, 用法
- 用法
- 用法
- #用法
- ??用法
- !!用法
- CustDialog用法 SimpleAdapter 用法
- hibernate_Restrictions用法 hibernate_Restrictions用法
- extern用法+assert用法
- getParameterValues用法
- rpm用法
- Log4j用法
- NameSpace用法
- sp_executesql 用法
- ShellExecute用法
- getParameterValues用法
- [JAVA]判断字符串是否为乱码
- sqlserver2005安装时报性能监视器计数器错误
- C#编写不安全代码 和应用程序域
- Activity详细介绍及其生命周期
- OpenXml 生成Office Word的 擴展類
- ttOptEstimateStats用法
- S2SH整合
- hdu 3884 Hinanai Tenshi’s peach garden
- 模块编译时出现not in prelink map错误
- 各大硬件官方网站
- C# GZipStream 压缩 解压
- Ogre源码分析与学习笔记-1
- 在PHP 5.3.5中出现Undefined offset: 0的解决方法
- brew制作lib