InnoDB Plugin  1.0
dict0stats.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 2009, 2012, Oracle and/or its affiliates. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation; version 2 of the License.
8 
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16 
17 *****************************************************************************/
18 
19 /**************************************************/
26 #ifndef dict0stats_h
27 #define dict0stats_h
28 
29 #include "univ.i"
30 
31 #include "db0err.h"
32 #include "dict0types.h"
33 #include "trx0types.h"
34 
35 enum dict_stats_upd_option_t {
36  DICT_STATS_RECALC_PERSISTENT,/* (re) calculate the
37  statistics using a precise and slow
38  algo and save them to the persistent
39  storage, if the persistent storage is
40  not present then emit a warning and
41  fall back to transient stats */
42  DICT_STATS_RECALC_TRANSIENT,/* (re) calculate the statistics
43  using an imprecise quick algo
44  without saving the results
45  persistently */
46  DICT_STATS_EMPTY_TABLE, /* Write all zeros (or 1 where it makes sense)
47  into a table and its indexes' statistics
48  members. The resulting stats correspond to an
49  empty table. If the table is using persistent
50  statistics, then they are saved on disk. */
51  DICT_STATS_FETCH_ONLY_IF_NOT_IN_MEMORY /* fetch the stats
52  from the persistent storage if the in-memory
53  structures have not been initialized yet,
54  otherwise do nothing */
55 };
56 
57 /*********************************************************************/
63 UNIV_INTERN
64 void
66 /*========================*/
67  dict_table_t* table);
69 /*********************************************************************/
73 UNIV_INLINE
74 void
76 /*======================*/
77  dict_table_t* table,
78  ibool ps_on,
79  ibool ps_off)
80  __attribute__((nonnull));
81 
82 /*********************************************************************/
85 UNIV_INLINE
86 ibool
88 /*=============================*/
89  const dict_table_t* table)
90  __attribute__((nonnull, warn_unused_result));
91 
92 /*********************************************************************/
97 UNIV_INLINE
98 void
100 /*=======================*/
101  dict_table_t* table,
102  ibool auto_recalc_on,
103  ibool auto_recalc_off);
105 /*********************************************************************/
108 UNIV_INLINE
109 ibool
111 /*==============================*/
112  const dict_table_t* table);
114 /*********************************************************************/
116 UNIV_INLINE
117 void
119 /*============*/
120  dict_table_t* table);
122 /*********************************************************************/
125 UNIV_INLINE
126 void
128 /*==============*/
129  dict_table_t* table)
130  __attribute__((nonnull));
131 
132 /*********************************************************************/
136 UNIV_INTERN
137 dberr_t
139 /*==============*/
140  dict_table_t* table,
141  dict_stats_upd_option_t stats_upd_option);
146 /*********************************************************************/
151 UNIV_INTERN
152 dberr_t
154 /*==================*/
155  const char* tname,
156  const char* iname,
157  char* errstr,
159  ulint errstr_sz);
161 /*********************************************************************/
166 UNIV_INTERN
167 dberr_t
169 /*==================*/
170  const char* table_name,
171  char* errstr,
173  ulint errstr_sz);
175 /*********************************************************************/
177 UNIV_INTERN
178 void
180 /*========================*/
181  dict_index_t* index)
182  __attribute__((nonnull));
183 
184 /*********************************************************************/
188 UNIV_INTERN
189 dberr_t
191 /*====================*/
192  const char* old_name,
193  const char* new_name,
194  char* errstr,
196  size_t errstr_sz);
198 #ifndef UNIV_NONINL
199 #include "dict0stats.ic"
200 #endif
201 
202 #endif /* dict0stats_h */