b4 - flags b4 - length b8 - parent b8 - next tuples
b8 - ptr to the actual data key - the tuple's key
412413414415416417418419420421422
Block rootBlock = allocateIndexBlock(); long rootBlockId = rootBlock.getBlockId(); rootBlock.free(); BTree btree = new BTree(this, rootBlockId, column.getLength(), keyCompare); column.setIndex(btree); } }
428429430431432433434435436437438439440441442443
throws IOException { Column []columns = _row.getColumns(); for (int i = 0; i < columns.length; i++) { BTree index = columns[i].getIndex(); if (index == null) continue; long rootAddr = index.getIndexRoot(); Block block = readBlock(addressToBlockId(rootAddr)); try { byte []blockBuffer = block.getBuffer();
593594595596597598599600601602603604605606
Column []columns = _row.getColumns(); for (int i = 0; i < columns.length; i++) { if (! columns[i].isUnique()) continue; BTree index = columns[i].getIndex(); if (index != null) { writeLong(os, index.getIndexRoot()); } else { writeLong(os, 0); } }
301302303304305306307308309310
*/ @Override void deleteIndex(DbTransaction xa, byte []block, int rowOffset) throws SQLException { BTree index = getIndex(); if (index != null) index.remove(block, rowOffset + _columnOffset, 4); }
*/ @Override void deleteIndex(Transaction xa, byte []block, int rowOffset) throws SQLException { BTree index = getIndex(); if (index != null) index.remove(block, rowOffset + _columnOffset, 4); }
75767778798081828384858687
int length = _column.getLength(); if (length <= 0) return; BTree index = _column.getIndex(); long value = index.lookup(buffer, 0, length); if (value != 0) { Table table = sourceRow.getTable(); long blockId = sourceRow.getBlockId();
283284285286287288289290291292293294
void setIndex(Transaction xa, byte []block, int rowOffset, long rowAddr, QueryContext context) throws SQLException { BTree index = getIndex(); if (index == null) return; index.insert(block, rowOffset + _columnOffset, 2, rowAddr, false); }
314315316317318319320321322323
*/ @Override void deleteIndex(Transaction xa, byte []block, int rowOffset) throws SQLException { BTree index = getIndex(); if (index != null) index.remove(block, rowOffset + _columnOffset, 2); }
284285286287288289290291292293294295
void setIndex(Transaction xa, byte []block, int rowOffset, long rowAddr, QueryContext context) throws SQLException { BTree index = getIndex(); if (index == null) return; index.insert(block, rowOffset + _columnOffset, 8, rowAddr, false); }
*/ @Override void deleteIndex(Transaction xa, byte []block, int rowOffset) throws SQLException { BTree index = getIndex(); if (index != null) index.remove(block, rowOffset + _columnOffset, 8); }