MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / update_selectivity

Function update_selectivity

src/jrd/btr.cpp:6963–6985  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6961
6962
6963void update_selectivity(index_root_page* root, USHORT id, const SelectivityList& selectivity)
6964{
6965/**************************************
6966 *
6967 * u p d a t e _ s e l e c t i v i t y
6968 *
6969 **************************************
6970 *
6971 * Functional description
6972 * Update selectivity on the index root page.
6973 *
6974 **************************************/
6975 //const Database* dbb = GET_DBB();
6976
6977 index_root_page::irt_repeat* irt_desc = &root->irt_rpt[id];
6978 const USHORT idx_count = irt_desc->irt_keys;
6979 fb_assert(selectivity.getCount() == idx_count);
6980
6981 // dimitr: per-segment selectivities exist only for ODS11 and above
6982 irtd* key_descriptor = (irtd*) ((UCHAR*) root + irt_desc->irt_desc);
6983 for (int i = 0; i < idx_count; i++, key_descriptor++)
6984 key_descriptor->irtd_selectivity = selectivity[i];
6985}

Callers 2

BTR_createFunction · 0.85
BTR_selectivityFunction · 0.85

Calls 1

getCountMethod · 0.45

Tested by

no test coverage detected