Results 1 to 3 of 3

Thread: I have some questions about STSDB.

  1. #1
    Junior Member
    Join Date
    Jun 2014

    Default I have some questions about STSDB.

    sorry,my english is poor,maybe I can not describe my question clear.

    1. what is the suggested Tree Depth about W-Tree,ensure the read/write performance?

    2. I find max_Operation/min_Operation property is no use in performance,when insert the record into db(record size is 256KB),I change the engine property:

    engine.LEAF_NODE_MAX_RECORDS = 32;
    engine.LEAF_NODE_MIN_RECORDS = 16;
    there is no obviously change in performance,why? in this condition ,if W-tree is like B+ tree .

    3. I was puzzled with the engine property when insert different record size, Could you provide me the plot or some recommendation about engine property and record size(big size like 4kb-256kb,or small size like 200 byte) ?

    4. when open a existed db file,I can also change the engine property, how STSDB deal with this engine property change?

    5. what is STSDB's block size?

    6. how C++ program use stsdb,or there is C++ SDK?

    7. is there performance difference between stsdb.fromfile() and stsdb.FromNetwork()?


  2. #2


    The W-Tree depth varies between two ranges:
            public int GetMinimumlWTreeDepth(long recordCount)
                int b = INTERNAL_NODE_MAX_BRANCHES;
                int I = INTERNAL_NODE_MAX_OPERATIONS;
                int L = LEAF_NODE_MAX_RECORDS;
                double depth = Math.Log(((recordCount - R) * (b - 1) + b * I) / (L * (b - 1) + I), b) + 1;
                return (int)Math.Ceiling(depth);
            public int GetMaximumWTreeDepth(long recordCount)
                int b = INTERNAL_NODE_MAX_BRANCHES;
                int L = LEAF_NODE_MAX_RECORDS;
                double depth = Math.Log(recordCount / L, b) + 1;
                return (int)Math.Ceiling(depth);
    Depth is a function of the above basic W-Tree properties. The depth varies depending on the W-Tree's internal state - whether there are records (operations) in the internal W-Tree nodes (a usual state after writes) or there are records only in the leaf nodes (a usual state after read, because the read process pours down the records to the leaf nodes).

    In general, the smaller the W-Tree depth, the higher the reading speed. But for the same number of records and for the same internal & leaf nodes capacities, smaller W-Tree depth requires larger number of branches. This means lower writing speed for the random inserts (the sequential insert perhaps will be slightly increased). So the W-Tree settings are balance between read and write speed.

    Current STSdb 4.0.6 W-Tree settings assume relatively small size of the record - about 100 bytes.
            public int INTERNAL_NODE_MIN_BRANCHES = 2; //default values
            public int INTERNAL_NODE_MAX_BRANCHES = 5;
            public int INTERNAL_NODE_MAX_OPERATIONS_IN_ROOT = 8 * 1024;
            public int INTERNAL_NODE_MIN_OPERATIONS = 32 * 1024;
            public int INTERNAL_NODE_MAX_OPERATIONS = 64 * 1024;
            public int LEAF_NODE_MIN_RECORDS = 8 * 1024;
            public int LEAF_NODE_MAX_RECORDS = 64 * 1024;
    With these settings each W-Tree node becomes about 100 * 64 * 1024 = 6.5MB. For this record size these are relatively optimal W-Tree settings. For larger record size we would recommend decreasing of the W-Tree properties proportionally - all except the MIN & MAX BRANCHES values. The idea no matter of record size is to keep the W-Tree nodes at least several megabytes, but also not too large (2-10MB). So if your average record size is about 100x than the default assumptions, you have to decrease MIN & MAX OPERATIONS and MIN & MAX RECORDS 100 times. You may also increase the engine.CacheSize 100 times (the default is 64) to keep the same amount of actually cached records in RAM.

    For details about W-Tree settings, you can see the Memory Usage topic.

    From theoretical point of view when MIN & MAX OPERATIONS for internal nodes are 0, the W-Tree becomes a B-Tree - a tree without buffers in the internal nodes. But we do not recommend these settings! They are untested and probably will not work at all.

    As for the W-Tree changes, you can change the W-Tree properties runtime, but we recommend you to do this before using the database.
    Last edited by a.todorov; 06.01.2015 at 15:37.

  3. #3


    Quote Originally Posted by swjtu_fb View Post

    6. how C++ program use stsdb,or there is C++ SDK?

    7. is there performance difference between stsdb.fromfile() and stsdb.FromNetwork()?


    6) For now, there is no C++ API for STSdb 4.0.

    7) Yes, there is a slight performance difference when using STSdb 4.0 over the network.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
2002 - 2014 STS Soft SC. All Rights reserved.
STSdb, Waterfall Tree and WTree are registered trademarks of STS Soft SC.