MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ndb_limits.h
1 /*
2  Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
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 as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef NDB_LIMITS_H
19 #define NDB_LIMITS_H
20 
21 #define RNIL 0xffffff00
22 
27 #define MAX_NDB_NODES 49
28 #define MAX_NODES 256
29 #define NDB_UNDEF_NODEGROUP 0xFFFF
30 #define MAX_BACKUPS 0xFFFFFFFF
31 
32 /**************************************************************************
33  * IT SHOULD BE (MAX_NDB_NODES - 1).
34  * WHEN MAX_NDB_NODE IS CHANGED, IT SHOULD BE CHANGED ALSO
35  **************************************************************************/
36 #define MAX_DATA_NODE_ID 48
37 /**************************************************************************
38  * IT SHOULD BE (MAX_NODES - 1).
39  * WHEN MAX_NODES IS CHANGED, IT SHOULD BE CHANGED ALSO
40  **************************************************************************/
41 #define MAX_NODES_ID 255
42 
50 #define MAX_REPLICAS 4
51 
55 #define MAX_LCP_STORED 3
56 
61 #define MAX_LCP_USED 2
62 
66 #define MAX_LOG_EXEC 4
67 
71 #define MAX_TUPLES_PER_PAGE 8191
72 #define MAX_TUPLES_BITS 13 /* 13 bits = 8191 tuples per page */
73 #define NDB_MAX_TABLES 20320 /* SchemaFile.hpp */
74 #define MAX_TAB_NAME_SIZE 128
75 #define MAX_ATTR_NAME_SIZE NAME_LEN /* From mysql_com.h */
76 #define MAX_ATTR_DEFAULT_VALUE_SIZE ((MAX_TUPLE_SIZE_IN_WORDS + 1) * 4) //Add 1 word for AttributeHeader
77 #define MAX_ATTRIBUTES_IN_TABLE 512
78 #define MAX_ATTRIBUTES_IN_INDEX 32
79 #define MAX_TUPLE_SIZE_IN_WORDS 3500
80 
85 #define MAX_SUMA_MESSAGE_IN_WORDS 8028
86 
91 #define CHECK_SUMA_MESSAGE_SIZE(NO_KEYS,KEY_SIZE_IN_WORDS,NO_COLUMNS,TUPLE_SIZE_IN_WORDS) \
92  ((NO_KEYS + KEY_SIZE_IN_WORDS + 2 * (NO_COLUMNS + TUPLE_SIZE_IN_WORDS)) <= MAX_SUMA_MESSAGE_IN_WORDS)
93 
94 #define MAX_KEY_SIZE_IN_WORDS 1023
95 #define MAX_FRM_DATA_SIZE 6000
96 #define MAX_NULL_BITS 4096
97 #define MAX_FRAGMENT_DATA_BYTES (4+(2 * 8 * MAX_REPLICAS * MAX_NDB_NODES))
98 #define MAX_NDB_PARTITIONS 1024
99 #define MAX_RANGE_DATA (131072+MAX_NDB_PARTITIONS) //0.5 MByte of list data
100 
101 #define MAX_WORDS_META_FILE 24576
102 
103 #define MIN_ATTRBUF ((MAX_ATTRIBUTES_IN_TABLE/24) + 1)
104 /*
105  * Max Number of Records to fetch per SCAN_NEXTREQ in a scan in LQH. The
106  * API can order a multiple of this number of records at a time since
107  * fragments can be scanned in parallel.
108  */
109 #define MAX_PARALLEL_OP_PER_SCAN 992
110 /*
111 * The default batch size. Configurable parameter.
112 */
113 #define DEF_BATCH_SIZE 64
114 /*
115 * When calculating the number of records sent from LQH in each batch
116 * one uses SCAN_BATCH_SIZE divided by the expected size of signals
117 * per row. This gives the batch size used for the scan. The NDB API
118 * will receive one batch from each node at a time so there has to be
119 * some care taken also so that the NDB API is not overloaded with
120 * signals.
121 * This parameter is configurable, this is the default value.
122 */
123 #define SCAN_BATCH_SIZE 32768
124 /*
125 * To protect the NDB API from overload we also define a maximum total
126 * batch size from all nodes. This parameter should most likely be
127 * configurable, or dependent on sendBufferSize.
128 * This parameter is configurable, this is the default value.
129 */
130 #define MAX_SCAN_BATCH_SIZE 262144
131 /*
132  * Maximum number of Parallel Scan queries on one hash index fragment
133  */
134 #define MAX_PARALLEL_SCANS_PER_FRAG 12
135 
139 #define MAXNROFATTRIBUTESINWORDS (MAX_ATTRIBUTES_IN_TABLE / 32)
140 
141 /*
142  * Ordered index constants. Make configurable per index later.
143  */
144 #define MAX_TTREE_NODE_SIZE 64 /* total words in node */
145 #define MAX_TTREE_PREF_SIZE 4 /* words in min prefix */
146 #define MAX_TTREE_NODE_SLACK 2 /* diff between max and min occupancy */
147 
148 /*
149  * Blobs.
150  */
151 #define NDB_BLOB_V1 1
152 #define NDB_BLOB_V2 2
153 #define NDB_BLOB_V1_HEAD_SIZE 2 /* sizeof(Uint64) >> 2 */
154 #define NDB_BLOB_V2_HEAD_SIZE 4 /* 2 + 2 + 4 + 8 bytes, see NdbBlob.hpp */
155 
156 /*
157  * Character sets.
158  */
159 #define MAX_XFRM_MULTIPLY 8 /* max expansion when normalizing */
160 
164 #define MAX_FILES_PER_FILEGROUP 1024
165 
169 #define GLOBAL_PAGE_SIZE 32768
170 #define GLOBAL_PAGE_SIZE_WORDS 8192
171 
172 /*
173  * Schema transactions
174  */
175 #define MAX_SCHEMA_TRANSACTIONS 5
176 #define MAX_SCHEMA_OPERATIONS 256
177 
178 /*
179  * Long signals
180  */
181 #define NDB_SECTION_SEGMENT_SZ 60
182 
183 /*
184  * Restore Buffer in pages
185  * 4M
186  */
187 #define LCP_RESTORE_BUFFER (4*32)
188 
189 #define NDB_DEFAULT_HASHMAP_BUCKTETS 240
190 
194 #define NDBMT_BLOCK_BITS 9
195 #define NDBMT_BLOCK_MASK ((1 << NDBMT_BLOCK_BITS) - 1)
196 #define NDBMT_BLOCK_INSTANCE_BITS 7
197 
198 #define MAX_NDBMT_LQH_WORKERS 4
199 #define MAX_NDBMT_LQH_THREADS 4
200 #define MAX_NDBMT_TC_THREADS 2
201 
202 #define NDB_FILE_BUFFER_SIZE (256*1024)
203 
207 #define MAXNROFATTRIBUTESINWORDS_OLD (128 / 32)
208 
212 #define MAX_ATTRIBUTES_IN_TABLE_NDB_EVENTS_0 4096
213 
220 #define NDB_SPJ_MAX_TREE_NODES 32
221 
222 /*
223  * Stored ordered index stats uses 2 Longvarbinary pseudo-columns: the
224  * packed index keys and the packed values. Key size is limited by
225  * SAMPLES table which has 3 other PK attributes. Also length bytes is
226  * counted as 1 word. Values currently contain RIR (one word) and RPK
227  * (one word for each key level). The SAMPLEs table STAT_VALUE column
228  * is longer to allow future changes.
229  *
230  * Stats tables are "lifted" to mysql level so for max key size use
231  * MAX_KEY_LENGTH/4 instead of the bigger MAX_KEY_SIZE_IN_WORDS. The
232  * definition is not available by default, use 3072 directly now.
233  */
234 #define MAX_INDEX_STAT_KEY_COUNT MAX_ATTRIBUTES_IN_INDEX
235 #define MAX_INDEX_STAT_KEY_SIZE ((3072/4) - 3 - 1)
236 #define MAX_INDEX_STAT_VALUE_COUNT (1 + MAX_INDEX_STAT_KEY_COUNT)
237 #define MAX_INDEX_STAT_VALUE_SIZE MAX_INDEX_STAT_VALUE_COUNT
238 #define MAX_INDEX_STAT_VALUE_CSIZE 512 /* Longvarbinary(2048) */
239 #define MAX_INDEX_STAT_VALUE_FORMAT 1
240 
241 #endif