<action dev="jahlborn" type="update">
Enable basic handling of unsupported data types as binary content.
</action>
+ <action dev="jahlborn" type="update">
+ Add methods to approximate table size.
+ </action>
</release>
<release version="1.2.4" date="2011-05-14">
<action dev="jahlborn" type="update">
return _maxPageEntrySize;
}
+ /**
+ * Returns the number of database pages owned by this index data.
+ */
+ public int getOwnedPageCount() {
+ return _ownedPages.getPageCount();
+ }
+
void addOwnedPage(int pageNumber) throws IOException {
_ownedPages.addPageNumber(pageNumber);
}
protected UsageMap.PageCursor getOwnedPagesCursor() {
return _ownedPages.cursor();
}
+
+ /**
+ * Returns the <i>approximate</i> number of database pages owned by this
+ * table and all related indexes (this number does <i>not</i> take into
+ * account pages used for large OLE/MEMO fields).
+ * <p>
+ * To calculate the approximate number of bytes owned by a table:
+ * <code>
+ * int approxTableBytes = (table.getApproximateOwnedPageCount() *
+ * table.getFormat().PAGE_SIZE);
+ * </code>
+ */
+ public int getApproximateOwnedPageCount() {
+ // add a page for the table def (although that might actually be more than
+ // one page)
+ int count = _ownedPages.getPageCount() + 1;
+ // note, we count owned pages from _physical_ indexes, not logical indexes
+ // (otherwise we could double count pages)
+ for(IndexData indexData : _indexDatas) {
+ count += indexData.getOwnedPageCount();
+ }
+ return count;
+ }
protected TempPageHolder getLongValueBuffer() {
return _longValueBufferH;