#include <NdbDictionary.hpp>
TableSize
When calculating the data storage one should add the size of all attributes (each attributeconsumes at least 4 bytes) and also an overhead of 12 byte. Variable size attributes (not supported yet) will have a size of 12 bytes plus the actual data storage parts where there is an additional overhead based on the size of the variable part.
An example table with 5 attributes: one 64 bit attribute, one 32 bit attribute, two 16 bit attributes and one array of 64 8 bits. This table will consume 12 (overhead) + 8 + 4 + 2*4 (4 is minimum) + 64 = 96 bytes per record. Additionally an overhead of about 2 % as page headers and waste should be allocated. Thus, 1 million records should consume 96 MBytes plus the overhead 2 MByte and rounded up to 100 000 kBytes.
NdbDictionary::NdbDictionary::Table::Table | ( | const char * | name = "" |
) |
Constructor
name | Name of table |
NdbDictionary::NdbDictionary::Table::Table | ( | const Table & | table | ) |
Copy constructor
table | Table to be copied |
int NdbDictionary::NdbDictionary::Table::addColumn | ( | const Column & | ) |
Add a column definition to a table
bool NdbDictionary::NdbDictionary::Table::equal | ( | const Table & | ) | const |
Check if table is equal to some other table
const Column* NdbDictionary::NdbDictionary::Table::getColumn | ( | const int | attributeId | ) | const |
Get column definition via index in table.
Column* NdbDictionary::NdbDictionary::Table::getColumn | ( | const char * | name | ) |
Get column definition via name.
Column* NdbDictionary::NdbDictionary::Table::getColumn | ( | const int | attributeId | ) |
Get column definition via index in table.
const Column* NdbDictionary::NdbDictionary::Table::getColumn | ( | const char * | name | ) | const |
Get column definition via name.
FragmentType NdbDictionary::NdbDictionary::Table::getFragmentType | ( | ) | const |
Get fragmentation type
const void* NdbDictionary::NdbDictionary::Table::getFrmData | ( | ) | const |
Get frm file stored with this table
int NdbDictionary::NdbDictionary::Table::getKValue | ( | ) | const |
Get KValue (Hash parameter.) Only allowed value is 6. Later implementations might add flexibility in this parameter.
bool NdbDictionary::NdbDictionary::Table::getLogging | ( | ) | const |
If set to false, then the table is a temporary table and is not logged to disk.
In case of a system restart the table will still be defined and exist but will be empty. Thus no checkpointing and no logging is performed on the table.
The default value is true and indicates a normal table with full checkpointing and logging activated.
int NdbDictionary::NdbDictionary::Table::getMaxLoadFactor | ( | ) | const |
Get MaxLoadFactor (Hash parameter.) This value specifies the load factor when starting to split the containers in the local hash tables. 100 is the maximum which will optimize memory usage. A lower figure will store less information in each container and thus find the key faster but consume more memory.
int NdbDictionary::NdbDictionary::Table::getMinLoadFactor | ( | ) | const |
Get MinLoadFactor (Hash parameter.) This value specifies the load factor when starting to shrink the hash table. It must be smaller than MaxLoadFactor. Both these factors are given in percentage.
const char* NdbDictionary::NdbDictionary::Table::getName | ( | ) | const |
Get table name
int NdbDictionary::NdbDictionary::Table::getNoOfColumns | ( | ) | const |
Get number of columns in the table
int NdbDictionary::NdbDictionary::Table::getNoOfPrimaryKeys | ( | ) | const |
Get number of primary keys in the table
virtual Object::Status NdbDictionary::NdbDictionary::Table::getObjectStatus | ( | ) | const [virtual] |
Get object status
Implements NdbDictionary::NdbDictionary::Object.
Object::Type NdbDictionary::NdbDictionary::Table::getObjectType | ( | ) | const |
Get table object type
virtual int NdbDictionary::NdbDictionary::Table::getObjectVersion | ( | ) | const [virtual] |
Get object version
Implements NdbDictionary::NdbDictionary::Object.
const char* NdbDictionary::NdbDictionary::Table::getPrimaryKey | ( | int | no | ) | const |
Get name of primary key
int NdbDictionary::NdbDictionary::Table::getTableId | ( | ) | const |
Get table id
Assignment operator, deep copy
table | Table to be copied |
void NdbDictionary::NdbDictionary::Table::setFragmentType | ( | FragmentType | ) |
Set fragmentation type
int NdbDictionary::NdbDictionary::Table::setFrm | ( | const void * | data, | |
Uint32 | len | |||
) |
Set frm file to store with this table
void NdbDictionary::NdbDictionary::Table::setKValue | ( | int | kValue | ) |
Set KValue (Hash parameter.) Only allowed value is 6. Later implementations might add flexibility in this parameter.
void NdbDictionary::NdbDictionary::Table::setLogging | ( | bool | ) |
void NdbDictionary::NdbDictionary::Table::setMaxLoadFactor | ( | int | ) |
Set MaxLoadFactor (Hash parameter.) This value specifies the load factor when starting to split the containers in the local hash tables. 100 is the maximum which will optimize memory usage. A lower figure will store less information in each container and thus find the key faster but consume more memory.
void NdbDictionary::NdbDictionary::Table::setMaxRows | ( | Uint64 | maxRows | ) |
Set/Get Maximum number of rows in table (only used to calculate number of partitions).
void NdbDictionary::NdbDictionary::Table::setMinLoadFactor | ( | int | ) |
Set MinLoadFactor (Hash parameter.) This value specifies the load factor when starting to shrink the hash table. It must be smaller than MaxLoadFactor. Both these factors are given in percentage.
void NdbDictionary::NdbDictionary::Table::setMinRows | ( | Uint64 | minRows | ) |
Set/Get Minimum number of rows in table (only used to calculate number of partitions).
int NdbDictionary::NdbDictionary::Table::setName | ( | const char * | name | ) |
Name of table
name | Name of table |
void NdbDictionary::NdbDictionary::Table::setObjectType | ( | Object::Type | type | ) |
Set table object type
void NdbDictionary::NdbDictionary::Table::setSingleUserMode | ( | enum | SingleUserMode | ) |
Set/Get SingleUserMode