MySQL Forums
Forum List  »  NDB clusters

NDB API:: use B-TREE index issue
Posted by: liu huil
Date: September 09, 2015 03:58AM

hi all
I create a table test index:

CREATE TABLE test(
ID VARCHAR(100) NOT NULL,
NUM VARCHAR(20) NOT NULL,
CALLED_NUM VARCHAR(20) NOT NULL,
PRIMARY KEY (ID, NUM)
)ENGINE NDB PARTITION BY key(NUM);

CREATE INDEX IDX_CALLED_NUM ON test(CALLED_NUM);

when use INDEX IDX_CALLED_NUM query record.
error msg: Function not implemented yet.

NDB support Support which indexs? Waiting for your reply thanks

Indexes. There are two different type of NDB indexes:
• Hash indexes are unique, but not ordered.
• B-tree indexes are ordered, but permit duplicate values.
Names of unique indexes and primary keys are handled as follows:
• For a MySQL UNIQUE index, both a B-tree and a hash index are created. The B-tree index uses the
MySQL name for the index; the name for the hash index is generated by appending '$unique' to the
index name.
• For a MySQL primary key only a B-tree index is created. This index is given the name PRIMARY.
There is no extra hash; however, the uniqueness of the primary key is guaranteed by making the
MySQL key the internal primary key of the NDB table.


test code:

const NdbDictionary::Index *myIndex= myDict->getIndex("IDX_CALLED_NUM","test");
if (myIndex == NULL)
APIERROR(myDict->getNdbError());

printf("status:%ld\n", myIndex->getObjectStatus());

// is ok

NdbTransaction *myTransaction= g_myNdb->startTransaction();
if (myTransaction == NULL) APIERROR(g_myNdb->getNdbError());

NdbIndexOperation *myIndexOperation=
myTransaction->getNdbIndexOperation(myIndex);
if (myIndexOperation == NULL) APIERROR(myTransaction->getNdbError());

// error msg: Function not implemented yet.

Options: ReplyQuote


Subject
Views
Written By
Posted
NDB API:: use B-TREE index issue
1852
September 09, 2015 03:58AM
875
September 15, 2015 12:48AM


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.