Enabling Statistics
Set the
row_counts attribute to
exact while creating a table or index.
Note: Statistics for a table or an index must be enabled at the creation time and cannot be enabled or disabled afterward.
The following is an example to create a table named
t1 with exact statistics enabled:
$ tibdg table create row_counts=exact t1 key long
Indexes on a table inherit the value of their table's
row_counts setting by default, but can be explicitly configured differently when they are created.
The following is an example to add a secondary index to the table
t1 created above with statistics disabled.
Create the index with
row_counts set to
off:
$ tibdg index create row_counts=off t1 index2 myfieldSee tibdg Table Stats to run a command to view statistics such as row counts or overall table size for a table and all of its indexes.
Note: As there is a minor performance impact associated with enabling statistics on a table or index, you can enable statistics on a table itself to maintain accurate row counts, but explicitly disable statistics on that table's secondary indexes.