青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

[翻譯]Berkeley DB 文檔 - C++入門篇 - 1.3節 - 訪問方式(Access Methods)

Access Methods
訪問方式

While this manual will focus primarily on the BTree access method, it is still useful to briefly describe all of the access methods that DB makes available.
本手冊先來關注一下B樹的訪問方式,這對概述DB其他可用的方式也有幫助.

Note that an access method can be selected only when the database is created. Once selected, actual API usage is generally identical across all access methods. That is, while some exceptions exist, mechanically you interact with the library in the same way regardless of which access method you have selected.
注意,只能在數據庫創建時設定訪問的方式.一旦選定,所有的訪問方式的API的使用實際上基本一致的.也就是說,雖然有一些例外的存在,但基本上你可以照本宣章的通過同樣的途徑控制數據庫而不用操心你選用的是何種方式.

The access method that you should choose is gated first by what you want to use as a key, and then secondly by the performance that you see for a given access method.
你選擇訪問的方式首先要考慮的是用什么來做鍵,然后根據性能選擇合適的訪問方式.

The following are the available access methods:
下面是可用的訪問方式:

BTree    
B樹

Data is stored in a sorted, balanced tree structure. Both the key and the data for BTree records can be arbitrarily complex. That is, they can contain single values such as an integer or a string, or complex types such as a structure. Also, although not the default behavior, it is possible for two records to use keys that compare as equals. When this occurs, the records are considered to be duplicates of one another.
數據被保存到有序平衡樹中.鍵和值都可以是任意復雜的.也就是說,他們(鍵和值)可以是單一的類型比如整數或字串,也可以是復雜的類型比如一個結構體.另外,盡管不是默認的行為,擁有兩個鍵等同的記錄也是可以的.這種情況下,這些記錄被認為一個是另一個的副本.

Hash    
哈希

Data is stored in an extended linear hash table. Like BTree, the key and the data used for Hash records can be of arbitrarily complex data. Also, like BTree, duplicate records are optionally supported.
數據被保存在一個擴展的線性哈希表中.和B樹類似,鍵和值可以是任意復雜的.另外,和B樹類似,多重記錄也是可選的.

Queue
隊列

Data is stored in a queue as fixed-length records. Each record uses a logical record number as its key. This access method is designed for fast inserts at the tail of the queue, and it has a special operation that deletes and returns a record from the head of the queue.
數據被保存在一個作為定長記錄集的隊列中.每個記錄使用一個邏輯記錄號作為鍵.這種訪問方式被用在需要在隊列尾巴快速插入數據的場合,它還有特殊的操作來返回和刪除頭部的數據.

This access method is unusual in that it provides record level locking. This can provide beneficial performance improvements in applications requiring concurrent access to the queue.
這種訪問方式與眾不同處在于他提供記錄級別的鎖.當程序需要并發的訪問隊列時,這一點可以提高性能.

Recno
Recno

Data is stored in either fixed or variable-length records. Like Queue, Recno records use logical record numbers as keys.
數據被保存在一個定長/變長記錄集中.類似Queueh,Recno使用邏輯記錄號作為鍵.

Selecting Access Methods
選擇訪問方式

To select an access method, you should first consider what you want to use as a key for you database records. If you want to use arbitrary data (even strings), then you should use either BTree or Hash. If you want to use logical record numbers (essentially integers) then you should use Queue or Recno.
選擇一種訪問方式你首先需要您的數據庫記錄集鍵的類型.如果你想使用任意類型的數據(甚至僅是字串),你就應該用B樹或哈希.如果你想使用邏輯記錄號(本質上說是整數),那么使用隊列或是Recon吧.

Once you have made this decision, you must choose between either BTree or Hash, or Queue or Recno. This decision is described next.
一旦你做出以上的決定,你就要在B樹,哈希,隊列,Recno中選取了.下面來對比描述一下.

Choosing between BTree and Hash
在B樹和哈希中選取

For small working datasets that fit entirely in memory, there is no difference between BTree and Hash. Both will perform just as well as the other. In this situation, you might just as well use BTree, if for no other reason than the majority of DB applications use BTree.
對于小到應該被完全加載到內存的工作數據集,B樹和哈希沒有什么區別.他們彼此的表現幾乎一樣優秀.這種情況下你或許應該選擇B樹,如果沒有特殊的原因,大半的DB應用使用B樹.

Note that the main concern here is your working dataset, not your entire dataset. Many applications maintain large amounts of information but only need to access some small portion of that data with any frequency. So what you want to consider is the data that you will routinely use, not the sum total of all the data managed by your application.
注意,這里主要關心的是你的工作數據集,不是你的整個數據集.許多應用維護著大量信息但是在任何情況下只需要訪問其中的一小部分.如此你就需要考慮你通常使用的數據,而不是你的應用程序使用的所有數據.

However, as your working dataset grows to the point where you cannot fit it all into memory, then you need to take more care when choosing your access method. Specifically, choose:
然而,當你的工作數據集增長到不能全部加載到內存的臨界點時,你就需要注意選擇訪問方式了,特別是,選擇:

    *    BTree if your keys have some locality of reference. That is, if they sort well and you can expect that a query for a given key will likely be followed by a query for one of its neighbors.
    *    B樹:如果你的鍵有位置上的關聯.也就是說,如果他們排序良好那么你可以預期一個給定鍵的查詢很可能在查詢它的一個鄰居之后.

    *    Hash if your dataset is extremely large. For any given access method, DB must maintain a certain amount of internal information. However, the amount of information that DB must maintain for BTree is much greater than for Hash. The result is that as your dataset grows, this internal information can dominate the cache to the point where there is relatively little space left for application data. As a result, BTree can be forced to perform disk I/O much more frequently than would Hash given the same amount of data.
    *    哈希:如果你的數據集非常巨大.所有的給出訪問方式,DB都要維護一個確定大小額外信息.然而,B樹比哈希所需要的額外信息多得多.結果就是當你的數據集增長時,額外信息可能裝滿了緩存相對的應用程序可用的空間就小了.影響就是,B樹不是不比哈希更頻繁的訪問相同數量的數據.

    Moreover, if your dataset becomes so large that DB will almost certainly have to perform disk I/O to satisfy a random request, then Hash will definitely out perform BTree because it has fewer internal records to search through than does BTree.
    更重要的是如果你的數據集龐大到DB幾乎肯定要執行磁盤I/O操作來滿足一個隨機的訪問,Hash毫無疑問的會勝出B樹因為它內部搜索的記錄更少.

Choosing between Queue and Recno
在隊列和Recno中選取

Queue or Recno are used when the application wants to use logical record numbers for the primary database key. Logical record numbers are essentially integers that uniquely identify the database record. They can be either mutable or fixed, where a mutable record number is one that might change as database records are stored or deleted. Fixed logical record numbers never change regardless of what database operations are performed.
隊列和Recno被用在當程序需要使用邏輯記錄號作為主記錄的鍵時.邏輯記錄號本質上是唯一標識記錄的整數。可以是變化的也可以是固定的,可變的記錄號可以在記錄數據數據保存或刪除時被改變.固定的邏輯記錄號無論數據庫如何運行也不會改變.

When deciding between Queue and Recno, choose:
當在隊列和Recno中取舍時:

    *      Queue if your application requires high degrees of concurrency. Queue provides record-level locking (as opposed to the page-level locking that the other access methods use), and this can result in significantly faster throughput for highly concurrent applications.
    *    隊列:如果你的應用需要高度并發.隊列提供了記錄級(record-level)的鎖(相對是另一種訪問方式的頁級(page-level)鎖),這在并發中性能有著顯著優勢.
   
    Note, however, that Queue provides support only for fixed length records. So if the size of the data that you want to store varies widely from record to record, you should probably choose an access method other than
    Queue.
    注意,然而,隊列只提供對定長記錄的支持.那么如果你的每條數據大小差異顯著,你可能需要隊列之外的一種訪問方式.
   
    *      Recno if you want mutable record numbers. Queue is only capable of providing fixed record numbers. Also, Recno provides support for databases whose permanent storage is a flat text file. This is useful for applications looking for fast, temporary storage while the data is being read or modified.
    *    Recno:如果你需要可變的記錄號.隊列只能提供固定的記錄號.同時,Recno支持將數據庫存儲在一個文本文件.這對需要快速,臨時存儲的正在讀取和修改數據的應用很有用.


posted on 2007-05-11 16:49 張沈鵬 閱讀(936) 評論(0)  編輯 收藏 引用 所屬分類: C++
 
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲女人天堂av| 亚洲一区二区免费看| 久久国产精品久久久久久久久久| 亚洲精品小视频| 欧美午夜精品久久久久久浪潮| 日韩一级二级三级| 一区二区三区导航| 国产精品乱码久久久久久| 欧美日韩精品一区二区三区| 9国产精品视频| 亚洲视频一区二区在线观看| 国产精品性做久久久久久| 国产精品久久77777| 午夜精品久久久久久久久久久久久 | 国产一区二区主播在线| 老鸭窝毛片一区二区三区| 免费观看亚洲视频大全| 欧美va天堂va视频va在线| 这里是久久伊人| 欧美在线一二三四区| 亚洲激情在线播放| 一区二区毛片| 在线成人性视频| 99re66热这里只有精品3直播 | 久久精品人人做人人爽电影蜜月| 久久免费黄色| 亚洲午夜一区二区三区| 久久精品99| 一区二区成人精品| 久久国产精品久久久久久| 亚洲日本aⅴ片在线观看香蕉| 一区二区三区欧美| 在线观看久久av| 正在播放亚洲| 亚洲肉体裸体xxxx137| 亚洲欧美精品伊人久久| 日韩午夜激情av| 久久er99精品| 亚洲欧美视频在线观看| 免费观看成人鲁鲁鲁鲁鲁视频| 午夜精品成人在线| 欧美黄污视频| 免费成人你懂的| 国产日韩欧美综合| 99热在这里有精品免费| 亚洲国产精品综合| 欧美一区二视频在线免费观看| 亚洲视频久久| 蜜臀a∨国产成人精品| 久久久999精品视频| 国产精品二区二区三区| 亚洲精品韩国| 在线看日韩欧美| 欧美中文字幕精品| 欧美亚洲三区| 国产精品欧美久久久久无广告| 亚洲国产一区二区三区a毛片| 一区二区三区在线视频观看 | 亚洲人成小说网站色在线| 精品福利免费观看| 欧美亚洲视频在线看网址| 午夜精品久久久久久久| 欧美日韩性生活视频| 亚洲精品国产日韩| 日韩天堂av| 欧美另类亚洲| av成人毛片| 欧美日韩国产综合新一区| 亚洲黄一区二区三区| 亚洲精品一区二区在线| 亚洲成色精品| 亚洲欧洲综合| 欧美人与禽猛交乱配| 日韩午夜视频在线观看| av成人动漫| 国产精品成人在线| 亚洲综合色激情五月| 久久精品在线观看| 激情综合色丁香一区二区| 久久久久久久综合色一本| 欧美va亚洲va国产综合| 亚洲靠逼com| 欧美日韩午夜精品| 亚洲影院一区| 老司机免费视频一区二区三区| 亚洲第一福利视频| 欧美黄色网络| 亚洲欧美成人一区二区三区| 久久久久久久久伊人| 亚洲国产精品va在线观看黑人| 美乳少妇欧美精品| av成人免费在线| 久久久久久亚洲精品杨幂换脸 | 亚洲欧美国产高清va在线播| 国产精品久久久一区二区三区| 亚洲自拍偷拍网址| 免费成人黄色av| 亚洲一区二区3| 国产日韩欧美自拍| 欧美xx69| 欧美一级播放| 亚洲欧洲三级电影| 欧美在线三区| 亚洲久色影视| 国语自产精品视频在线看一大j8| 欧美国产先锋| 久久精品盗摄| 一区二区三区成人| 亚洲福利视频一区| 欧美在线中文字幕| 日韩视频免费大全中文字幕| 国产日韩精品在线观看| 欧美大片一区二区| 欧美一区视频| 一区二区三区四区国产| 欧美大片va欧美在线播放| 亚洲欧美区自拍先锋| 亚洲国产精品传媒在线观看| 国产精品普通话对白| 欧美黄色免费网站| 久久美女性网| 欧美一进一出视频| 在线亚洲精品| 亚洲人成亚洲人成在线观看| 久久久久88色偷偷免费| 午夜一级在线看亚洲| 一区二区电影免费观看| 亚洲黄一区二区| 精品91免费| 国产一区二区毛片| 国产精品国产a级| 欧美日韩国产精品| 欧美丰满少妇xxxbbb| 久久久久久夜精品精品免费| 亚洲欧美美女| 亚洲男人的天堂在线观看| 99视频日韩| 一区二区精品国产| 一区二区三区久久| 亚洲视频 欧洲视频| 亚洲乱码一区二区| 亚洲精品日韩在线| 亚洲日本va午夜在线电影| 亚洲激情av| 亚洲伦理网站| 一区二区欧美亚洲| 亚洲特色特黄| 亚洲综合日本| 午夜精品av| 国产精品美腿一区在线看| 国产精品国产一区二区| 国产精品乱码久久久久久| 国产精品乱码一区二区三区| 国产精品一区二区a| 国产精品尤物| 国产一区二区精品久久91| 国产一区白浆| 亚洲第一页在线| 亚洲精品女av网站| 亚洲深夜福利| 羞羞答答国产精品www一本| 久久激情视频| 欧美韩国日本综合| 亚洲三级视频| 亚洲欧美伊人| 久久久久久久久久看片| 美女视频网站黄色亚洲| 亚洲精品在线三区| 中国亚洲黄色| 欧美一区二区三区视频免费播放| 欧美在线视频观看免费网站| 久久综合影音| 欧美午夜欧美| 国内久久婷婷综合| 亚洲人成网站999久久久综合| 一区二区三区波多野结衣在线观看| 99亚洲一区二区| 久久精品理论片| 亚洲欧洲日韩在线| 久久精品国产一区二区电影 | 亚洲在线一区| 蜜桃av噜噜一区| 亚洲天堂网在线观看| 久久蜜桃香蕉精品一区二区三区| 欧美精品首页| 激情视频一区二区| 亚洲小说区图片区| 猫咪成人在线观看| 中国女人久久久| 美女亚洲精品| 国产视频欧美| 亚洲桃色在线一区| 亚洲国产美国国产综合一区二区| 亚洲伊人观看| 亚洲第一毛片| 欧美一区激情| 国产精品视频在线观看| 亚洲日本视频| 男人的天堂亚洲在线| 亚洲一区二区三区乱码aⅴ蜜桃女|