~vadim-tk/percona-server/percona-galera-5.1.57

« back to all changes in this revision

Viewing changes to storage/ndb/include/kernel/ndb_limits.h

  • Committer: root
  • Date: 2011-07-10 16:09:24 UTC
  • Revision ID: root@r815.office.percona.com-20110710160924-fyffqsbaclgu6vui
Initial port

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#ifndef NDB_LIMITS_H
 
17
#define NDB_LIMITS_H
 
18
 
 
19
#include <mysql.h>
 
20
 
 
21
#define RNIL    0xffffff00
 
22
 
 
23
/**
 
24
 * Note that actual value = MAX_NODES - 1,
 
25
 *  since NodeId = 0 can not be used
 
26
 */
 
27
#define MAX_NDB_NODES 49
 
28
#define MAX_NODES     64
 
29
#define UNDEF_NODEGROUP 0xFFFF
 
30
 
 
31
/**************************************************************************
 
32
 * IT SHOULD BE (MAX_NDB_NODES - 1).
 
33
 * WHEN MAX_NDB_NODE IS CHANGED, IT SHOULD BE CHANGED ALSO
 
34
 **************************************************************************/
 
35
#define MAX_DATA_NODE_ID 48
 
36
/**************************************************************************
 
37
 * IT SHOULD BE (MAX_NODES - 1).
 
38
 * WHEN MAX_NODES IS CHANGED, IT SHOULD BE CHANGED ALSO
 
39
 **************************************************************************/
 
40
#define MAX_NODES_ID 63
 
41
 
 
42
/**
 
43
 * MAX_API_NODES = MAX_NODES - No of NDB Nodes in use
 
44
 */
 
45
 
 
46
/**
 
47
 * The maximum number of replicas in the system
 
48
 */
 
49
#define MAX_REPLICAS 4
 
50
 
 
51
/**
 
52
 * The maximum number of local checkpoints stored at a time
 
53
 */
 
54
#define MAX_LCP_STORED 3
 
55
 
 
56
/**
 
57
 * The maximum number of log execution rounds at system restart
 
58
 */
 
59
#define MAX_LOG_EXEC 4
 
60
 
 
61
/**
 
62
 * The maximum number of tuples per page
 
63
 **/
 
64
#define MAX_TUPLES_PER_PAGE 8191
 
65
#define MAX_TUPLES_BITS 13              /* 13 bits = 8191 tuples per page */
 
66
#define MAX_TABLES 20320                /* SchemaFile.hpp */
 
67
#define MAX_TAB_NAME_SIZE 128
 
68
#define MAX_ATTR_NAME_SIZE NAME_LEN       /* From mysql_com.h */
 
69
#define MAX_ATTR_DEFAULT_VALUE_SIZE 128
 
70
#define MAX_ATTRIBUTES_IN_TABLE 128
 
71
#define MAX_ATTRIBUTES_IN_INDEX 32
 
72
#define MAX_TUPLE_SIZE_IN_WORDS 2013
 
73
#define MAX_KEY_SIZE_IN_WORDS 1023
 
74
#define MAX_FRM_DATA_SIZE 6000
 
75
#define MAX_NULL_BITS 4096
 
76
#define MAX_FRAGMENT_DATA_BYTES (4+(2 * 8 * MAX_REPLICAS * MAX_NDB_NODES))
 
77
#define MAX_NDB_PARTITIONS 1024
 
78
#define MAX_RANGE_DATA (131072+MAX_NDB_PARTITIONS) //0.5 MByte of list data
 
79
 
 
80
#define MAX_WORDS_META_FILE 24576
 
81
 
 
82
#define MIN_ATTRBUF ((MAX_ATTRIBUTES_IN_TABLE/24) + 1)
 
83
/*
 
84
 * Max Number of Records to fetch per SCAN_NEXTREQ in a scan in LQH. The
 
85
 * API can order a multiple of this number of records at a time since
 
86
 * fragments can be scanned in parallel.
 
87
 */
 
88
#define MAX_PARALLEL_OP_PER_SCAN 992
 
89
/*
 
90
* The default batch size. Configurable parameter.
 
91
*/
 
92
#define DEF_BATCH_SIZE 64
 
93
/*
 
94
* When calculating the number of records sent from LQH in each batch
 
95
* one uses SCAN_BATCH_SIZE divided by the expected size of signals
 
96
* per row. This gives the batch size used for the scan. The NDB API
 
97
* will receive one batch from each node at a time so there has to be
 
98
* some care taken also so that the NDB API is not overloaded with
 
99
* signals.
 
100
* This parameter is configurable, this is the default value.
 
101
*/
 
102
#define SCAN_BATCH_SIZE 32768
 
103
/*
 
104
* To protect the NDB API from overload we also define a maximum total
 
105
* batch size from all nodes. This parameter should most likely be
 
106
* configurable, or dependent on sendBufferSize.
 
107
* This parameter is configurable, this is the default value.
 
108
*/
 
109
#define MAX_SCAN_BATCH_SIZE 262144
 
110
/*
 
111
 * Maximum number of Parallel Scan queries on one hash index fragment
 
112
 */
 
113
#define MAX_PARALLEL_SCANS_PER_FRAG 12
 
114
/*
 
115
 * Maximum parallel ordered index scans per primary table fragment.
 
116
 * Implementation limit is (256 minus 12).
 
117
 */
 
118
#define MAX_PARALLEL_INDEX_SCANS_PER_FRAG 32
 
119
 
 
120
/**
 
121
 * Computed defines
 
122
 */
 
123
#define MAXNROFATTRIBUTESINWORDS (MAX_ATTRIBUTES_IN_TABLE / 32)
 
124
 
 
125
/*
 
126
 * Ordered index constants.  Make configurable per index later.
 
127
 */
 
128
#define MAX_TTREE_NODE_SIZE 64      /* total words in node */
 
129
#define MAX_TTREE_PREF_SIZE 4       /* words in min prefix */
 
130
#define MAX_TTREE_NODE_SLACK 2      /* diff between max and min occupancy */
 
131
 
 
132
/*
 
133
 * Blobs.
 
134
 */
 
135
#define NDB_BLOB_HEAD_SIZE 2        /* sizeof(NdbBlob::Head) >> 2 */
 
136
 
 
137
/*
 
138
 * Character sets.
 
139
 */
 
140
#define MAX_XFRM_MULTIPLY 8         /* max expansion when normalizing */
 
141
 
 
142
/**
 
143
 * Disk data
 
144
 */
 
145
#define MAX_FILES_PER_FILEGROUP 1024
 
146
 
 
147
/**
 
148
 * Page size in global page pool
 
149
 */
 
150
#define GLOBAL_PAGE_SIZE 32768
 
151
#define GLOBAL_PAGE_SIZE_WORDS 8192
 
152
 
 
153
/*
 
154
 * Long signals
 
155
 */
 
156
#define NDB_SECTION_SEGMENT_SZ 60
 
157
 
 
158
/*
 
159
 * Restore Buffer in pages
 
160
 *   4M
 
161
 */
 
162
#define LCP_RESTORE_BUFFER (4*32)
 
163
 
 
164
#endif