|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/nbtree.h"#include "access/tableam.h"#include "common/int.h"
Go to the source code of this file.
Data Structures | |
| struct | SplitPoint |
| struct | FindSplitData |
Macros | |
| #define | LEAF_SPLIT_DISTANCE 0.050 |
| #define | INTERNAL_SPLIT_DISTANCE 0.075 |
Enumerations | |
| enum | FindSplitStrat { SPLIT_DEFAULT , SPLIT_MANY_DUPLICATES , SPLIT_SINGLE_VALUE } |
Functions | |
| static void | _bt_recsplitloc (FindSplitData *state, OffsetNumber firstrightoff, bool newitemonleft, int olddataitemstoleft, Size firstrightofforigpagetuplesz) |
| static void | _bt_deltasortsplits (FindSplitData *state, double fillfactormult, bool usemult) |
| static int | _bt_splitcmp (const void *arg1, const void *arg2) |
| static bool | _bt_afternewitemoff (FindSplitData *state, OffsetNumber maxoff, int leaffillfactor, bool *usemult) |
| static bool | _bt_adjacenthtid (const ItemPointerData *lowhtid, const ItemPointerData *highhtid) |
| static OffsetNumber | _bt_bestsplitloc (FindSplitData *state, int perfectpenalty, bool *newitemonleft, FindSplitStrat strategy) |
| static int | _bt_defaultinterval (FindSplitData *state) |
| static int | _bt_strategy (FindSplitData *state, SplitPoint *leftpage, SplitPoint *rightpage, FindSplitStrat *strategy) |
| static void | _bt_interval_edges (FindSplitData *state, SplitPoint **leftinterval, SplitPoint **rightinterval) |
| static int | _bt_split_penalty (FindSplitData *state, SplitPoint *split) |
| static IndexTuple | _bt_split_lastleft (FindSplitData *state, SplitPoint *split) |
| static IndexTuple | _bt_split_firstright (FindSplitData *state, SplitPoint *split) |
| OffsetNumber | _bt_findsplitloc (Relation rel, Page origpage, OffsetNumber newitemoff, Size newitemsz, IndexTuple newitem, bool *newitemonleft) |
| #define INTERNAL_SPLIT_DISTANCE 0.075 |
Definition at line 851 of file nbtsplitloc.c.
| #define LEAF_SPLIT_DISTANCE 0.050 |
Definition at line 850 of file nbtsplitloc.c.
| enum FindSplitStrat |
| Enumerator | |
|---|---|
| SPLIT_DEFAULT | |
| SPLIT_MANY_DUPLICATES | |
| SPLIT_SINGLE_VALUE | |
Definition at line 21 of file nbtsplitloc.c.
|
static |
Definition at line 750 of file nbtsplitloc.c.
References FirstOffsetNumber, ItemPointerGetBlockNumber(), and ItemPointerGetOffsetNumber().
Referenced by _bt_afternewitemoff().
|
static |
Definition at line 631 of file nbtsplitloc.c.
References _bt_adjacenthtid(), _bt_keep_natts_fast(), Assert(), BTreeTupleIsPosting(), IndexRelationGetNumberOfKeyAttributes, MAXALIGN, OffsetNumberPrev, P_FIRSTKEY, PageGetItem(), PageGetItemId(), and IndexTupleData::t_tid.
Referenced by _bt_findsplitloc().
|
static |
Definition at line 789 of file nbtsplitloc.c.
References _bt_split_penalty(), final, i, Min, and SPLIT_MANY_DUPLICATES.
Referenced by _bt_findsplitloc().
|
static |
Definition at line 877 of file nbtsplitloc.c.
References i, INTERNAL_SPLIT_DISTANCE, LEAF_SPLIT_DISTANCE, SplitPoint::leftfree, and SplitPoint::rightfree.
Referenced by _bt_findsplitloc().
|
static |
Definition at line 567 of file nbtsplitloc.c.
References _bt_splitcmp(), SplitPoint::curdelta, i, if(), SplitPoint::leftfree, qsort, and SplitPoint::rightfree.
Referenced by _bt_findsplitloc().
| OffsetNumber _bt_findsplitloc | ( | Relation | rel, |
| Page | origpage, | ||
| OffsetNumber | newitemoff, | ||
| Size | newitemsz, | ||
| IndexTuple | newitem, | ||
| bool * | newitemonleft | ||
| ) |
Definition at line 130 of file nbtsplitloc.c.
References _bt_afternewitemoff(), _bt_bestsplitloc(), _bt_defaultinterval(), _bt_deltasortsplits(), _bt_recsplitloc(), _bt_strategy(), Assert(), BTGetFillFactor, BTPageGetOpaque, BTREE_NONLEAF_FILLFACTOR, BTREE_SINGLEVAL_FILLFACTOR, BTreeTupleIsPosting(), elog, ERROR, SplitPoint::firstrightoff, i, IndexRelationGetNumberOfKeyAttributes, ItemIdGetLength, MAXALIGN, SplitPoint::newitemonleft, OffsetNumberNext, P_FIRSTDATAKEY, P_HIKEY, P_ISLEAF, P_RIGHTMOST, PageGetExactFreeSpace(), PageGetItemId(), PageGetMaxOffsetNumber(), PageGetPageSize(), palloc(), pfree(), RelationGetRelationName, SizeOfPageHeaderData, SPLIT_DEFAULT, SPLIT_MANY_DUPLICATES, and SPLIT_SINGLE_VALUE.
Referenced by _bt_split().
|
static |
Definition at line 1053 of file nbtsplitloc.c.
References Assert(), SplitPoint::firstrightoff, i, Min, and SplitPoint::newitemonleft.
Referenced by _bt_strategy().
|
static |
Definition at line 450 of file nbtsplitloc.c.
References Assert(), BTreeTupleGetPostingOffset(), BTreeTupleIsPosting(), IndexTupleSize(), MAXALIGN, Min, PageGetItem(), and PageGetItemId().
Referenced by _bt_findsplitloc().
|
inlinestatic |
Definition at line 1176 of file nbtsplitloc.c.
References SplitPoint::firstrightoff, SplitPoint::newitemonleft, PageGetItem(), and PageGetItemId().
Referenced by _bt_split_penalty(), and _bt_strategy().
|
inlinestatic |
Definition at line 1160 of file nbtsplitloc.c.
References SplitPoint::firstrightoff, SplitPoint::newitemonleft, OffsetNumberPrev, PageGetItem(), and PageGetItemId().
Referenced by _bt_split_penalty(), and _bt_strategy().
|
inlinestatic |
Definition at line 1132 of file nbtsplitloc.c.
References _bt_keep_natts_fast(), _bt_split_firstright(), _bt_split_lastleft(), SplitPoint::firstrightoff, ItemIdGetLength, MAXALIGN, SplitPoint::newitemonleft, and PageGetItemId().
Referenced by _bt_bestsplitloc().
|
static |
Definition at line 595 of file nbtsplitloc.c.
References SplitPoint::curdelta, and pg_cmp_s16().
Referenced by _bt_deltasortsplits().
|
static |
Definition at line 935 of file nbtsplitloc.c.
References _bt_interval_edges(), _bt_keep_natts_fast(), _bt_split_firstright(), _bt_split_lastleft(), IndexRelationGetNumberOfKeyAttributes, P_HIKEY, PageGetItem(), PageGetItemId(), SPLIT_DEFAULT, SPLIT_MANY_DUPLICATES, and SPLIT_SINGLE_VALUE.
Referenced by _bt_findsplitloc().