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

[翻譯]Berkeley DB 文檔 - C++入門篇 - 1.3節(jié) - 訪問方式(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.
本手冊先來關(guān)注一下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.
注意,只能在數(shù)據(jù)庫創(chuàng)建時設(shè)定訪問的方式.一旦選定,所有的訪問方式的API的使用實際上基本一致的.也就是說,雖然有一些例外的存在,但基本上你可以照本宣章的通過同樣的途徑控制數(shù)據(jù)庫而不用操心你選用的是何種方式.

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.
你選擇訪問的方式首先要考慮的是用什么來做鍵,然后根據(jù)性能選擇合適的訪問方式.

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.
數(shù)據(jù)被保存到有序平衡樹中.鍵和值都可以是任意復(fù)雜的.也就是說,他們(鍵和值)可以是單一的類型比如整數(shù)或字串,也可以是復(fù)雜的類型比如一個結(jié)構(gòu)體.另外,盡管不是默認(rèn)的行為,擁有兩個鍵等同的記錄也是可以的.這種情況下,這些記錄被認(rèn)為一個是另一個的副本.

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.
數(shù)據(jù)被保存在一個擴(kuò)展的線性哈希表中.和B樹類似,鍵和值可以是任意復(fù)雜的.另外,和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.
數(shù)據(jù)被保存在一個作為定長記錄集的隊列中.每個記錄使用一個邏輯記錄號作為鍵.這種訪問方式被用在需要在隊列尾巴快速插入數(shù)據(jù)的場合,它還有特殊的操作來返回和刪除頭部的數(shù)據(jù).

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.
這種訪問方式與眾不同處在于他提供記錄級別的鎖.當(dāng)程序需要并發(fā)的訪問隊列時,這一點可以提高性能.

Recno
Recno

Data is stored in either fixed or variable-length records. Like Queue, Recno records use logical record numbers as keys.
數(shù)據(jù)被保存在一個定長/變長記錄集中.類似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.
選擇一種訪問方式你首先需要您的數(shù)據(jù)庫記錄集鍵的類型.如果你想使用任意類型的數(shù)據(jù)(甚至僅是字串),你就應(yīng)該用B樹或哈希.如果你想使用邏輯記錄號(本質(zhì)上說是整數(shù)),那么使用隊列或是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.
對于小到應(yīng)該被完全加載到內(nèi)存的工作數(shù)據(jù)集,B樹和哈希沒有什么區(qū)別.他們彼此的表現(xiàn)幾乎一樣優(yōu)秀.這種情況下你或許應(yīng)該選擇B樹,如果沒有特殊的原因,大半的DB應(yīng)用使用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.
注意,這里主要關(guān)心的是你的工作數(shù)據(jù)集,不是你的整個數(shù)據(jù)集.許多應(yīng)用維護(hù)著大量信息但是在任何情況下只需要訪問其中的一小部分.如此你就需要考慮你通常使用的數(shù)據(jù),而不是你的應(yīng)用程序使用的所有數(shù)據(jù).

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:
然而,當(dāng)你的工作數(shù)據(jù)集增長到不能全部加載到內(nèi)存的臨界點時,你就需要注意選擇訪問方式了,特別是,選擇:

    *    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樹:如果你的鍵有位置上的關(guān)聯(lián).也就是說,如果他們排序良好那么你可以預(yù)期一個給定鍵的查詢很可能在查詢它的一個鄰居之后.

    *    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.
    *    哈希:如果你的數(shù)據(jù)集非常巨大.所有的給出訪問方式,DB都要維護(hù)一個確定大小額外信息.然而,B樹比哈希所需要的額外信息多得多.結(jié)果就是當(dāng)你的數(shù)據(jù)集增長時,額外信息可能裝滿了緩存相對的應(yīng)用程序可用的空間就小了.影響就是,B樹不是不比哈希更頻繁的訪問相同數(shù)量的數(shù)據(jù).

    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.
    更重要的是如果你的數(shù)據(jù)集龐大到DB幾乎肯定要執(zhí)行磁盤I/O操作來滿足一個隨機(jī)的訪問,Hash毫無疑問的會勝出B樹因為它內(nèi)部搜索的記錄更少.

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被用在當(dāng)程序需要使用邏輯記錄號作為主記錄的鍵時.邏輯記錄號本質(zhì)上是唯一標(biāo)識記錄的整數(shù)。可以是變化的也可以是固定的,可變的記錄號可以在記錄數(shù)據(jù)數(shù)據(jù)保存或刪除時被改變.固定的邏輯記錄號無論數(shù)據(jù)庫如何運行也不會改變.

When deciding between Queue and Recno, choose:
當(dāng)在隊列和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.
    *    隊列:如果你的應(yīng)用需要高度并發(fā).隊列提供了記錄級(record-level)的鎖(相對是另一種訪問方式的頁級(page-level)鎖),這在并發(fā)中性能有著顯著優(yōu)勢.
   
    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.
    注意,然而,隊列只提供對定長記錄的支持.那么如果你的每條數(shù)據(jù)大小差異顯著,你可能需要隊列之外的一種訪問方式.
   
    *      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支持將數(shù)據(jù)庫存儲在一個文本文件.這對需要快速,臨時存儲的正在讀取和修改數(shù)據(jù)的應(yīng)用很有用.


posted on 2007-05-11 16:49 張沈鵬 閱讀(925) 評論(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>
            欧美大片一区二区| 亚洲二区在线观看| 一区二区三区精密机械公司| 亚洲理论在线观看| 国产乱肥老妇国产一区二| 亚洲国产成人在线播放| 欧美系列电影免费观看| 91久久夜色精品国产网站| 亚洲精品久久久久久久久| 欧美精品福利视频| 亚洲三级观看| 香港久久久电影| 国产美女一区二区| 欧美a级大片| 夜夜嗨av色一区二区不卡| 性色一区二区三区| 国产色视频一区| 欧美风情在线观看| 亚洲在线观看视频| 久热国产精品| 亚洲精品一级| 欧美午夜无遮挡| 久久久人成影片一区二区三区| 欧美h视频在线| 久久久久久自在自线| 亚洲第一精品电影| 久久久久久久精| 美女网站久久| 午夜精品理论片| 亚洲精品综合| 午夜在线一区二区| 亚洲欧洲在线观看| 欧美噜噜久久久xxx| 久久青青草原一区二区| 久久福利资源站| 亚洲伦理精品| 葵司免费一区二区三区四区五区| 亚洲天堂偷拍| 国产精品99久久久久久久女警 | 亚洲伦理在线观看| 亚洲一区国产| 一本大道久久a久久综合婷婷 | 欧美高清在线| 久久久精品一品道一区| 亚洲一级免费视频| 一区二区三区日韩| 亚洲人体影院| 伊人色综合久久天天| 国产精品一级久久久| 国产裸体写真av一区二区| 国产日韩欧美日韩| 国产中文一区二区| 国产一区亚洲| 亚洲国产高清一区| 亚洲精品一区在线| 亚洲日本理论电影| 99这里只有精品| 夜夜夜久久久| 欧美一级片在线播放| 午夜精品久久久久久久99樱桃| 久久国产精品久久精品国产| 美日韩免费视频| 欧美日韩精品免费观看| 欧美无砖砖区免费| 国产精品人成在线观看免费| 欧美日韩成人网| 国产视频精品网| 亚洲精品国产欧美| 久久久久久久999精品视频| 午夜欧美大片免费观看| 久久影视精品| 男男成人高潮片免费网站| 亚洲免费电影在线观看| 欧美伊人久久久久久久久影院 | 亚洲一区免费观看| 欧美一区免费视频| 欧美日韩国产123| 在线国产欧美| 久久国产精品亚洲va麻豆| 欧美福利精品| 香蕉成人伊视频在线观看| 欧美大片专区| 在线不卡中文字幕播放| 欧美一区二区女人| 一区二区三区日韩精品| 嫩模写真一区二区三区三州| 在线欧美日韩精品| 久久综合九色综合欧美就去吻| 久久婷婷亚洲| 国产精品豆花视频| 亚洲一本大道在线| 亚洲国产一区在线| 免费观看成人www动漫视频| 最新国产の精品合集bt伙计| 久久人人爽国产| 久久精品国产综合精品| 国产乱理伦片在线观看夜一区| 亚洲小视频在线| 夜夜嗨av一区二区三区中文字幕 | 久久久久久久久蜜桃| 在线综合欧美| 久久激情一区| 欧美在线观看www| 国产精品一区在线观看你懂的| 久久精品免费观看| 国产一区二区成人| 久久久久免费观看| 欧美成人三级在线| 亚洲私人影院在线观看| 亚洲一二三四久久| 国内精品久久久久影院优 | 一区二区日本视频| 亚洲视频一二| 亚洲二区在线视频| 亚洲国产精品尤物yw在线观看| 欧美成人日本| 久久久噜噜噜久久狠狠50岁| 美女久久一区| 亚洲一区区二区| 久久成人久久爱| 一区二区三区国产| 嫩草成人www欧美| 先锋影院在线亚洲| 欧美日韩一区二区三| 亚洲第一天堂av| 欧美a级在线| 羞羞漫画18久久大片| 久久久久久穴| 欧美在线观看一区二区| 国产精品成人在线观看| 老**午夜毛片一区二区三区| 欧美韩日一区二区三区| 久久久久久久一区| 国产精品一区在线播放| 99这里只有精品| 中文av一区二区| 欧美黄污视频| 欧美激情一区二区三区成人| 国产免费亚洲高清| 一本色道久久综合一区| av不卡免费看| 国产精品成人免费视频| 一本一本a久久| 日韩网站在线| 欧美人成在线| 国产亚洲成年网址在线观看| 久久琪琪电影院| 国产日韩欧美在线看| 午夜精品久久久久影视 | 国产亚洲成av人片在线观看桃| 老鸭窝亚洲一区二区三区| 国产精品任我爽爆在线播放| 一区二区三区日韩精品视频| 亚洲一区二区成人在线观看| 欧美国产日韩a欧美在线观看| 欧美国产视频日韩| 亚洲国产裸拍裸体视频在线观看乱了 | 亚洲国产精品久久精品怡红院| 国产在线观看一区| 美玉足脚交一区二区三区图片| 亚洲电影视频在线| 夜夜嗨av一区二区三区| 国产日韩欧美一区二区三区四区| 久久九九全国免费精品观看| 亚洲高清资源| 亚洲女同同性videoxma| 韩国一区电影| 国产精品免费aⅴ片在线观看| 亚洲在线视频网站| 亚洲风情亚aⅴ在线发布| 性欧美xxxx视频在线观看| 亚洲激情一区| 国产一区二区三区在线观看精品 | 欧美一区二区视频观看视频| 午夜精品成人在线| 日韩一级网站| 合欧美一区二区三区| 欧美国产高潮xxxx1819| 久久精品国产综合精品| 欧美在线播放一区| 在线一区观看| 99国产精品私拍| 夜夜爽av福利精品导航| 欧美日韩国产精品| 一区二区三区四区五区精品| 欧美国产亚洲精品久久久8v| 欧美影院精品一区| 亚洲免费人成在线视频观看| 99精品国产在热久久下载| 91久久在线视频| 亚洲高清中文字幕| 亚洲国产mv| 日韩午夜中文字幕| 一区二区三区偷拍| 中文一区字幕| 欧美在线视频全部完| 久久久91精品| 久久高清国产| 欧美国产亚洲视频| 亚洲国产小视频|