1 #ifndef OPT_STATISTICS_INCLUDED
2 #define OPT_STATISTICS_INCLUDED
3 
4 /*
5    Copyright (c) 2014, 2021, Oracle and/or its affiliates.
6 
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License, version 2.0,
9    as published by the Free Software Foundation.
10 
11    This program is also distributed with certain software (including
12    but not limited to OpenSSL) that is licensed under separate terms,
13    as designated in a particular file or component or in included license
14    documentation.  The authors of MySQL hereby grant you an additional
15    permission to link the program and your derivative works with the
16    separately licensed software that they have included with MySQL.
17 
18    This program is distributed in the hope that it will be useful,
19    but WITHOUT ANY WARRANTY; without even the implied warranty of
20    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21    GNU General Public License, version 2.0, for more details.
22 
23    You should have received a copy of the GNU General Public License
24    along with this program; if not, write to the Free Software Foundation,
25    51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
26 
27 #include "my_global.h"                          // uint
28 
29 struct TABLE;
30 typedef float rec_per_key_t;
31 typedef struct st_key KEY;
32 
33 /**
34   Guesstimate for "records per key" when index statistics is not available.
35 
36   @param table         the table
37   @param key           the index
38   @param used_keyparts the number of key part that should be included in the
39                        estimate
40 
41   @return estimated records per key value
42 */
43 
44 rec_per_key_t guess_rec_per_key(const TABLE *const table, const KEY *const key,
45                                 uint used_keyparts);
46 
47 #endif /* OPT_STATISTICS_INCLUDED */
48