~ubuntu-branches/ubuntu/utopic/mariadb-5.5/utopic-security

« back to all changes in this revision

Viewing changes to storage/tokudb/ft-index/ft/ft-internal.h

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2014-08-27 21:12:36 UTC
  • mfrom: (2.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20140827211236-se41hwfe4xy0hpef
* d/control: Removed Provides: libmysqlclient-dev (Closes: #759309)
* d/control: Removed Provides: libmysqld-dev with same motivation
* Re-introduced tha HPPA build patch as the upstream fix wasn't complete
* Fixed all kFreeBSD build and test suite issues
* Added Italian translation (Closes: #759813)

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
enum { FT_DEFAULT_NODE_SIZE = 4 * 1024 * 1024 };
124
124
enum { FT_DEFAULT_BASEMENT_NODE_SIZE = 128 * 1024 };
125
125
 
 
126
// We optimize for a sequential insert pattern if 100 consecutive injections
 
127
// happen into the rightmost leaf node due to promotion.
 
128
enum { FT_SEQINSERT_SCORE_THRESHOLD = 100 };
 
129
 
126
130
//
127
131
// Field in ftnode_fetch_extra that tells the 
128
132
// partial fetch callback what piece of the node
572
576
 
573
577
    // is this ft a blackhole? if so, all messages are dropped.
574
578
    bool blackhole;
 
579
 
 
580
    // The blocknum of the rightmost leaf node in the tree. Stays constant through splits
 
581
    // and merges using pair-swapping (like the root node, see toku_ftnode_swap_pair_values())
 
582
    // 
 
583
    // This field only transitions from RESERVED_BLOCKNUM_NULL to non-null, never back.
 
584
    // We initialize it when promotion inserts into a non-root leaf node on the right extreme.
 
585
    // We use the blocktable lock to protect the initialize transition, though it's not really
 
586
    // necessary since all threads should be setting it to the same value. We maintain that invariant
 
587
    // on first initialization, see ft_set_or_verify_rightmost_blocknum()
 
588
    BLOCKNUM rightmost_blocknum;
 
589
 
 
590
    // sequential access pattern heuristic
 
591
    // - when promotion pushes a message directly into the rightmost leaf, the score goes up.
 
592
    // - if the score is high enough, we optimistically attempt to insert directly into the rightmost leaf
 
593
    // - if our attempt fails because the key was not in range of the rightmost leaf, we reset the score back to 0
 
594
    uint32_t seqinsert_score;
575
595
};
576
596
 
577
597
// Allocate a DB struct off the stack and only set its comparison
1037
1057
 
1038
1058
int
1039
1059
toku_verify_ftnode (FT_HANDLE ft_h,
1040
 
                    MSN rootmsn, MSN parentmsn, bool messages_exist_above,
 
1060
                    MSN rootmsn, MSN parentmsn_with_messages, bool messages_exist_above,
1041
1061
                     FTNODE node, int height,
1042
1062
                     const DBT *lesser_pivot,               // Everything in the subtree should be > lesser_pivot.  (lesser_pivot==NULL if there is no lesser pivot.)
1043
1063
                     const DBT *greatereq_pivot,            // Everything in the subtree should be <= lesser_pivot.  (lesser_pivot==NULL if there is no lesser pivot.)
1186
1206
    FT_PRO_NUM_DIDNT_WANT_PROMOTE,
1187
1207
    FT_BASEMENT_DESERIALIZE_FIXED_KEYSIZE, // how many basement nodes were deserialized with a fixed keysize
1188
1208
    FT_BASEMENT_DESERIALIZE_VARIABLE_KEYSIZE, // how many basement nodes were deserialized with a variable keysize
 
1209
    FT_PRO_RIGHTMOST_LEAF_SHORTCUT_SUCCESS,
 
1210
    FT_PRO_RIGHTMOST_LEAF_SHORTCUT_FAIL_POS,
 
1211
    FT_PRO_RIGHTMOST_LEAF_SHORTCUT_FAIL_REACTIVE,
1189
1212
    FT_STATUS_NUM_ROWS
1190
1213
} ft_status_entry;
1191
1214