MySQL Forums
Forum List  »  NDB clusters

questions on the size example in documentation
Posted by: richard horan
Date: May 23, 2006 06:35AM

I need help in understanding this example. First I will show the example then ask my question. Any help on this will be greatly appreciated.

The following example illustrates how memory is used for a table. Consider this table definition:

CREATE TABLE example (
a INT NOT NULL,
b INT NOT NULL,
c INT NOT NULL,
PRIMARY KEY(a),
UNIQUE(b)
) ENGINE=NDBCLUSTER;

For each record, there are 12 bytes of data plus 12 bytes overhead. Having no nullable columns saves 4 bytes of overhead. In addition, we have two ordered indexes on columns a and b consuming roughly 10 bytes each per record. There is a primary key hash index on the base table using roughly 29 bytes per record. The unique constraint is implemented by a separate table with b as primary key and a as a column. This other table consumes an additional 29 bytes of index memory per record in the example table as well 8 bytes of record data plus 12 bytes of overhead.

Thus, for one million records, we need 58MB for index memory to handle the hash indexes for the primary key and the unique constraint. We also need 64MB for the records of the base table and the unique index table, plus the two ordered index tables.

----------
Question: the two ordered indexes on columns a and b, if they where say VARCHAR(32) would it still be only 10 bytes per record for the ordered index? what if they were VARCHAR(128)?

Options: Reply• Quote


Subject
Views
Written By
Posted
questions on the size example in documentation
2242
May 23, 2006 06:35AM
1311
May 31, 2006 01:20AM
1231
June 05, 2006 09:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.