📄 dup.so
字号:
m4_comment([$Id: dup.so,v 10.28 2003/10/18 19:15:54 bostic Exp $])m4_ref_title(Access Methods, Duplicate data items, @duplicate data items, am_conf/byteorder, am_conf/malloc)m4_p([dnlThe Btree and Hash access methods support the creation of multiple dataitems for a single key item. By default, multiple data items are notpermitted, and each database store operation will overwrite any previousdata item for that key. To configure m4_db for duplicate data items,call the m4_refT(dbh_set_flags) with the m4_ref(DB_DUP) flag. Only onecopy of the key will be stored for each set of duplicate data items.If the Btree access method comparison routine returns that two keyscompare equally, it is undefined which of the two keys will be storedand returned from future database operations.])m4_p([dnlBy default, m4_db stores duplicates in the order in which they were added,that is, each new duplicate data item will be stored after any alreadyexisting data items. This default behavior can be overridden by usingthe m4_refT(dbc_put) and one of the m4_ref(DB_AFTER), m4_ref(DB_BEFORE)m4_ref(DB_KEYFIRST) or m4_ref(DB_KEYLAST) flags. Alternatively, m4_dbmay be configured to sort duplicate data items.])m4_p([dnlWhen stepping through the database sequentially, duplicate data items willbe returned individually, as a key/data pair, where the key item onlychanges after the last duplicate data item has been returned. For thisreason, duplicate data items cannot be accessed using them4_refT(dbh_get), as it always returns the first of the duplicate dataitems. Duplicate data items should be retrieved using a m4_db cursorinterface such as the m4_refT(dbc_get).])m4_p([dnlThere is a flag that permits applications to request the following dataitem only if it m4_bold(is) a duplicate data item of the current entry,see m4_ref(DB_NEXT_DUP) for more information. There is a flag thatpermits applications to request the following data item only if itm4_bold(is not) a duplicate data item of the current entry, seem4_ref(DB_NEXT_NODUP) and m4_ref(DB_PREV_NODUP) for more information.])m4_p([dnlIt is also possible to maintain duplicate records in sorted order. Sortingduplicates will significantly increase performance when searching themand performing equality joins, common operations when using secondaryindices. To configure m4_db to sort duplicate data items, the applicationmust call the m4_refT(dbh_set_flags) with the m4_ref(DB_DUPSORT) flag (inaddition to the m4_ref(DB_DUP) flag). In addition, a custom comparisonfunction may be specified using the m4_refT(dbh_set_dup_compare). If them4_ref(DB_DUPSORT) flag is given, but no comparison routine is specified,then m4_db defaults to the same lexicographical sorting used for Btreekeys, with shorter items collating before longer items.])m4_p([dnlIf the duplicate data items are unsorted, applications may store identicalduplicate data items, or, for those that just like the way it sounds,m4_italic(duplicate duplicates).])m4_p([dnlm4_bold([In this release it is an error to attempt to store identicalduplicate data items when duplicates are being stored in a sorted order.])This restriction is expected to be lifted in a future release. Thereis a flag that permits applications to disallow storing duplicate dataitems when the database has been configured for sorted duplicates, seem4_ref(DB_NODUPDATA) for more information. Applications not wanting topermit duplicate duplicates in databases configured for sortedduplicates should begin using the m4_ref(DB_NODUPDATA) flag immediately.])m4_p([dnlFor further information on how searching and insertion behaves in thepresence of duplicates (sorted or not), see the m4_ref(dbh_get),m4_ref(dbh_put), m4_ref(dbc_get) and m4_ref(dbc_put) documentation.])m4_page_footer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -