1 /*
2    Copyright (c) 2011, 2021, Oracle and/or its affiliates.
3 
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License, version 2.0,
6    as published by the Free Software Foundation.
7 
8    This program is also distributed with certain software (including
9    but not limited to OpenSSL) that is licensed under separate terms,
10    as designated in a particular file or component or in included license
11    documentation.  The authors of MySQL hereby grant you an additional
12    permission to link the program and your derivative works with the
13    separately licensed software that they have included with MySQL.
14 
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License, version 2.0, for more details.
19 
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
23 */
24 
25 #include <ndb_global.h>
26 #include "NdbIndexStatImpl.hpp"
27 
28 #if ndb_index_stat_systables_sql
29 
30 use mysql;
31 
32 create table ndb_index_stat_head (
33   index_id int unsigned not null,
34   index_version int unsigned not null,
35   table_id int unsigned not null,
36   frag_count int unsigned not null,
37   value_format int unsigned not null,
38   sample_version int unsigned not null,
39   load_time int unsigned not null,
40   sample_count int unsigned not null,
41   key_bytes int unsigned not null,
42   primary key using hash (
43     index_id, index_version)
44 ) engine=ndb;
45 
46 create table ndb_index_stat_sample (
47   index_id int unsigned not null,
48   index_version int unsigned not null,
49   sample_version int unsigned not null,
50   stat_key varbinary(3056) not null, -- ((3072/4) - 3 - 1) * 4
51   stat_value varbinary(2048) not null, -- 512 * 4
52   primary key using hash (
53     index_id, index_version, sample_version, stat_key),
54   index ndb_index_stat_sample_x1 (
55     index_id, index_version, sample_version)
56 ) engine=ndb;
57 
58 #endif
59 
60 // rest dumped from *.frm by tools/ndb_dump_frm_data
61 
62 /*
63   name: ndb_index_stat_head
64   orig: 8918
65   pack: 402
66 */
67 
68 const uint g_ndb_index_stat_head_frm_len = 402;
69 
70 const uint8 g_ndb_index_stat_head_frm_data[402] =
71 {
72   0x01,0x00,0x00,0x00,0xd6,0x22,0x00,0x00,
73   0x86,0x01,0x00,0x00,0x78,0x9c,0xed,0xda,
74   0xbf,0x4e,0xc2,0x40,0x1c,0x07,0xf0,0x6f,
75   0xcb,0xdf,0x1e,0x50,0x08,0x21,0x0c,0x0c,
76   0xa6,0x31,0x21,0x11,0x17,0x9d,0x9d,0xc4,
77   0xc4,0x81,0x18,0x95,0x10,0x16,0x5c,0x9a,
78   0x02,0x87,0xa9,0x02,0x35,0xb4,0x10,0xd9,
79   0x78,0x27,0x1e,0xc1,0x77,0xf0,0x29,0x7c,
80   0x06,0xcf,0x2b,0x50,0x3c,0x36,0x16,0x83,
81   0x9a,0xdf,0x67,0xba,0xfb,0xf6,0x2e,0xf9,
82   0xe5,0xbb,0xb5,0xe9,0xa7,0x66,0x98,0x31,
83   0xa0,0xa0,0x01,0xe7,0x80,0xab,0x55,0xb1,
84   0xa5,0x9f,0x22,0x0d,0x24,0xc2,0x65,0x3a,
85   0xca,0x5c,0x79,0xee,0xe3,0x0d,0xb8,0x58,
86   0xed,0x4c,0xe0,0xec,0x0c,0xb0,0x40,0x08,
87   0x21,0x84,0x10,0x42,0x08,0x21,0x84,0x90,
88   0xdf,0x4c,0xd3,0x01,0x86,0xf0,0x0d,0x5f,
89   0x8f,0xc9,0xdd,0x42,0x6e,0x2b,0x97,0x71,
90   0xe8,0x8b,0xe4,0x7a,0x21,0x9a,0xad,0xc6,
91   0x6d,0xbd,0xd5,0x11,0x87,0x1e,0xf4,0xaf,
92   0xdb,0xb3,0x40,0x86,0x71,0xbf,0xdb,0x1b,
93   0x4e,0xfd,0x80,0x4f,0x4a,0x72,0x6f,0x35,
94   0xeb,0xad,0x76,0xa3,0xdd,0xb8,0xbf,0xb3,
95   0xae,0x3a,0xd6,0xcd,0x75,0xc7,0x3a,0xa9,
96   0x41,0x2b,0xfe,0xe8,0xa8,0x84,0x10,0x42,
97   0x08,0x21,0x84,0x10,0x42,0xfe,0x9f,0x77,
98   0x1d,0x85,0x43,0xcf,0x70,0x48,0x1a,0x0c,
99   0x2c,0xf1,0x20,0x57,0x55,0x3c,0x6d,0xd3,
100   0x26,0xca,0x9b,0xd5,0x12,0xcc,0xd0,0x4b,
101   0x35,0x6b,0x4f,0x88,0xc3,0x70,0xc7,0x7d,
102   0xfe,0x6a,0xbb,0x7d,0x24,0x60,0xae,0xd7,
103   0x33,0x3e,0xf1,0x5d,0x6f,0x8c,0x24,0x8c,
104   0xc0,0xe9,0x0e,0x79,0xf8,0x30,0x85,0xcc,
105   0x60,0xe2,0x3c,0xda,0x3d,0x6f,0x3a,0x0e,
106   0x90,0x46,0x6e,0xe6,0x0c,0xa7,0xdc,0x1e,
107   0x78,0x93,0x91,0x13,0xc8,0xa1,0xf2,0xbe,
108   0x33,0x7a,0x91,0x47,0xa3,0xbb,0x0c,0x6c,
109   0xe8,0x39,0x7d,0x3b,0x70,0x47,0x1c,0x19,
110   0xe4,0x36,0x8f,0xd7,0xd7,0xb3,0x60,0xcf,
111   0x7c,0x6e,0x77,0xe7,0x01,0xf7,0x11,0x37,
112   0x18,0xc3,0xea,0x3b,0x8e,0x9c,0x3f,0x16,
113   0xfe,0xc2,0x61,0xca,0x20,0xa9,0x04,0xc9,
114   0xf0,0x04,0x53,0x82,0x54,0x46,0x06,0xa6,
115   0x12,0xa4,0x73,0x32,0x28,0x2a,0x81,0x91,
116   0x97,0x41,0x59,0x09,0x98,0x84,0x8a,0x12,
117   0x64,0xc2,0x2b,0x47,0x4a,0x90,0x0d,0x4f,
118   0x1c,0x2b,0x81,0x88,0x9a,0x11,0x3b,0xb5,
119   0x88,0xa8,0x13,0xf1,0x5d,0x88,0x50,0xdb,
120   0x10,0xbb,0x55,0x88,0x6d,0x0f,0x42,0x2d,
121   0x41,0x6c,0x1b,0x10,0xf8,0x02,0xe7,0x16,
122   0x7d,0xd4
123 };
124 
125 /*
126   name: ndb_index_stat_sample
127   orig: 12842
128   pack: 371
129 */
130 
131 const uint g_ndb_index_stat_sample_frm_len = 371;
132 
133 const uint8 g_ndb_index_stat_sample_frm_data[371] =
134 {
135   0x01,0x00,0x00,0x00,0x2a,0x32,0x00,0x00,
136   0x67,0x01,0x00,0x00,0x78,0x9c,0xed,0xda,
137   0x3b,0x4f,0xc2,0x60,0x18,0x05,0xe0,0xd3,
138   0x1b,0xf4,0xa2,0x85,0x81,0x38,0x38,0x35,
139   0x71,0x01,0x17,0x74,0x71,0x32,0x11,0x8c,
140   0x9a,0x10,0xa3,0x12,0xc2,0xc2,0xd4,0x80,
141   0xed,0x40,0xc4,0x6a,0xb8,0x05,0xb6,0xfe,
142   0x36,0xfd,0x3b,0x0e,0xfc,0x00,0xe3,0x67,
143   0x69,0xa9,0xc0,0x62,0xdc,0x8a,0xc9,0x79,
144   0xa6,0xb7,0xa7,0x5f,0x9a,0xf3,0x6d,0x1d,
145   0xde,0x2f,0xc9,0xb4,0x15,0xa0,0x28,0x01,
146   0x35,0xe0,0x4d,0x46,0x09,0x29,0x79,0x06,
147   0x03,0xd0,0x96,0xa3,0x9e,0x66,0xd1,0x01,
148   0x7c,0xbc,0x03,0x67,0xf1,0x93,0x0d,0x54,
149   0xab,0xc0,0x09,0x88,0x88,0x88,0x88,0x88,
150   0x88,0x88,0x68,0x97,0xc9,0x79,0xe0,0x08,
151   0x65,0x7c,0x5a,0xaa,0x02,0x48,0xa1,0x04,
152   0x1c,0xd6,0x54,0xc8,0xa1,0x96,0x0c,0x4a,
153   0x68,0x24,0x83,0x1a,0xee,0x47,0xef,0x6b,
154   0x0b,0x4b,0xc2,0x1e,0xa2,0xa3,0xbf,0x9d,
155   0x15,0xcd,0x56,0xe3,0xae,0xde,0xea,0x88,
156   0xc0,0xeb,0xb9,0xfd,0xc0,0xf3,0x67,0xee,
157   0x68,0xdc,0x1d,0xbb,0xa3,0xee,0xf3,0xeb,
158   0xc0,0x77,0x67,0xa7,0x22,0xeb,0x6b,0x13,
159   0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,
160   0x11,0xd1,0x3f,0x60,0x22,0xf0,0x7a,0x8f,
161   0x83,0xc9,0x68,0xec,0x0f,0x97,0xeb,0x6b,
162   0x4e,0xb3,0xde,0x6a,0x37,0xda,0x8d,0x87,
163   0x7b,0xe7,0xb2,0xe3,0xdc,0x5e,0x77,0x9c,
164   0x72,0x05,0x92,0x9d,0x75,0x4d,0x22,0x22,
165   0x22,0xa2,0x9d,0x70,0x2c,0xa3,0x98,0x75,
166   0x87,0x2c,0x49,0xd0,0x30,0x87,0xbd,0xfc,
167   0x6d,0x2c,0x9d,0xff,0xa4,0x4d,0x1c,0xac,
168   0xa6,0x39,0x72,0x9a,0x5c,0xaa,0x38,0x7f,
169   0x04,0x15,0x46,0xb2,0xf0,0xd0,0xf7,0xa2,
170   0x2f,0xdb,0xc9,0x3c,0xf5,0x87,0xa3,0xfe,
171   0x4b,0x80,0x1c,0x0a,0xab,0x15,0x88,0x34,
172   0xc9,0xc3,0x88,0x37,0x23,0x9e,0xfc,0x39,
173   0x74,0x58,0xf1,0x3c,0xed,0x0e,0x26,0x3e,
174   0x54,0xc3,0x34,0x11,0x6f,0x58,0x44,0x2d,
175   0x14,0x1d,0xd0,0xec,0x28,0xd0,0x36,0x82,
176   0x5c,0x21,0x0a,0x8c,0x8d,0x20,0x6f,0xdc,
177   0x2c,0xac,0x78,0x4b,0x23,0x0a,0x0a,0x17,
178   0x80,0x6e,0x5d,0x41,0x17,0xd6,0x3a,0x10,
179   0x69,0x37,0xb1,0x55,0x4c,0x6c,0xb7,0x12,
180   0x69,0x25,0xb1,0xee,0x23,0xf0,0x0d,0x53,
181   0x4c,0x66,0xbc
182 };
183