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

[翻譯]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.
本手冊(cè)先來關(guān)注一下B樹的訪問方式,這對(duì)概述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í)設(shè)定訪問的方式.一旦選定,所有的訪問方式的API的使用實(shí)際上基本一致的.也就是說,雖然有一些例外的存在,但基本上你可以照本宣章的通過同樣的途徑控制數(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ù)雜的類型比如一個(gè)結(jié)構(gòu)體.另外,盡管不是默認(rèn)的行為,擁有兩個(gè)鍵等同的記錄也是可以的.這種情況下,這些記錄被認(rèn)為一個(gè)是另一個(gè)的副本.

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ù)被保存在一個(gè)擴(kuò)展的線性哈希表中.和B樹類似,鍵和值可以是任意復(fù)雜的.另外,和B樹類似,多重記錄也是可選的.

Queue
隊(duì)列

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ù)被保存在一個(gè)作為定長(zhǎng)記錄集的隊(duì)列中.每個(gè)記錄使用一個(gè)邏輯記錄號(hào)作為鍵.這種訪問方式被用在需要在隊(duì)列尾巴快速插入數(shù)據(jù)的場(chǎng)合,它還有特殊的操作來返回和刪除頭部的數(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.
這種訪問方式與眾不同處在于他提供記錄級(jí)別的鎖.當(dāng)程序需要并發(fā)的訪問隊(duì)列時(shí),這一點(diǎn)可以提高性能.

Recno
Recno

Data is stored in either fixed or variable-length records. Like Queue, Recno records use logical record numbers as keys.
數(shù)據(jù)被保存在一個(gè)定長(zhǎng)/變長(zhǎng)記錄集中.類似Queueh,Recno使用邏輯記錄號(hào)作為鍵.

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樹或哈希.如果你想使用邏輯記錄號(hào)(本質(zhì)上說是整數(shù)),那么使用隊(duì)列或是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樹,哈希,隊(duì)列,Recno中選取了.下面來對(duì)比描述一下.

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.
對(duì)于小到應(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ù)集,不是你的整個(gè)數(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ù)集增長(zhǎng)到不能全部加載到內(nèi)存的臨界點(diǎn)時(shí),你就需要注意選擇訪問方式了,特別是,選擇:

    *    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ù)期一個(gè)給定鍵的查詢很可能在查詢它的一個(gè)鄰居之后.

    *    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ù)一個(gè)確定大小額外信息.然而,B樹比哈希所需要的額外信息多得多.結(jié)果就是當(dāng)你的數(shù)據(jù)集增長(zhǎng)時(shí),額外信息可能裝滿了緩存相對(duì)的應(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操作來滿足一個(gè)隨機(jī)的訪問,Hash毫無疑問的會(huì)勝出B樹因?yàn)樗鼉?nèi)部搜索的記錄更少.

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

When deciding between Queue and Recno, choose:
當(dāng)在隊(duì)列和Recno中取舍時(shí):

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


posted on 2007-05-11 16:49 張沈鵬 閱讀(925) 評(píng)論(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一区二区三区四区| 久久久亚洲国产美女国产盗摄| 香蕉av福利精品导航| 国产精品欧美经典| 久久成人18免费网站| 久久激情视频久久| 亚洲日产国产精品| 日韩视频在线播放| 国产精品美女999| 免费成人高清| 欧美日韩在线另类| 久久国产精品久久久久久电车| 午夜日韩在线| 日韩手机在线导航| 亚洲欧美日韩国产一区| 136国产福利精品导航网址| 亚洲人成在线观看网站高清| 欧美人与性动交α欧美精品济南到| 亚洲自拍偷拍麻豆| 久久久久久有精品国产| 亚洲一级二级| 久久亚洲私人国产精品va媚药| 一本色道久久综合精品竹菊| 欧美一区二区在线观看| 亚洲国产精品热久久| 亚洲性图久久| 亚洲激情第一页| 亚洲欧美日韩精品久久奇米色影视 | 久久成人免费| 欧美高清影院| 久久久综合激的五月天| 亚洲乱码精品一二三四区日韩在线| 在线亚洲激情| 亚洲精品在线免费观看视频| 欧美一区二区视频在线观看2020| 中文精品一区二区三区| 久久亚洲精品中文字幕冲田杏梨| 欧美一区二区成人6969| 欧美高清视频www夜色资源网| 欧美一区二区福利在线| 欧美视频一区在线| 亚洲国产精品悠悠久久琪琪| 国内精品**久久毛片app| 夜夜躁日日躁狠狠久久88av| 亚洲精品视频免费| 久久久久久久久综合| 午夜精品影院| 国产精品久久7| 亚洲美女黄色| 在线中文字幕一区| 欧美成人免费在线| 亚洲动漫精品| 亚洲人成网站影音先锋播放| 老牛影视一区二区三区| 久久国内精品视频| 国产女优一区| 午夜久久久久久| 久久成人国产精品| 国产亚洲毛片在线| 欧美一区二区三区的| 久久精品国产亚洲精品| 国产女主播一区二区三区| 亚洲午夜免费福利视频| 亚洲在线一区二区三区| 国产精品久久九九| 亚洲欧美激情视频在线观看一区二区三区| 亚洲图片你懂的| 欧美天天在线| 亚洲欧美日韩国产一区| 久久国产66| 在线高清一区| 欧美福利一区二区三区| 99国产精品国产精品毛片| 亚洲欧美另类在线观看| 国产精品国产福利国产秒拍| 亚洲自拍电影| 久久久噜噜噜久久| 亚洲国产日韩欧美在线动漫| 欧美肥婆在线| 亚洲一区二区三区午夜| 久久亚洲春色中文字幕| 亚洲国产精品美女| 欧美视频中文一区二区三区在线观看 | 亚洲激情六月丁香| 欧美日本一区| 亚洲欧美日本国产专区一区| 美女视频黄 久久| 99视频一区| 国产欧美日韩综合一区在线播放 | 香港久久久电影| 欧美激情偷拍| 亚洲欧美日韩第一区| 国产一区二区精品久久99| 米奇777超碰欧美日韩亚洲| 日韩一级成人av| 久久综合五月天婷婷伊人| 9人人澡人人爽人人精品| 国产伦精品一区二区三区视频黑人 | 日韩午夜在线电影| 国产精品一区二区三区四区五区 | 久久先锋资源| 亚洲视频一二三| 麻豆免费精品视频| 亚洲香蕉成视频在线观看| 黑人极品videos精品欧美裸| 欧美日韩国产一区二区三区| 欧美一区亚洲二区| 日韩系列欧美系列| 免费在线看成人av| 午夜久久电影网| 亚洲巨乳在线| 国产中文一区二区| 欧美三级在线视频| 男女激情久久| 久久久久久久网| 亚洲一区二区三区涩| 亚洲精品视频在线看| 老色鬼久久亚洲一区二区| 亚洲免费影视第一页| 日韩视频免费观看高清完整版| 国内伊人久久久久久网站视频| 欧美日韩精品是欧美日韩精品| 久久综合99re88久久爱| 午夜一区不卡| 这里只有视频精品| 99国产精品自拍| 最新中文字幕一区二区三区| 麻豆国产va免费精品高清在线| 午夜精品久久| 国产精品99久久久久久www| 91久久综合| 91久久极品少妇xxxxⅹ软件| 在线看欧美视频| 一区二区亚洲| 极品少妇一区二区三区精品视频| 国产欧美精品一区二区色综合 | 亚洲欧美日韩精品久久久久| 日韩午夜免费视频| 99re亚洲国产精品| 亚洲久久在线| 国产精品99久久不卡二区| 一区二区欧美视频| 亚洲精品网址在线观看| 亚洲人成在线观看一区二区 | 欧美日韩一区二区免费视频| 欧美日韩免费观看中文| 国产精品国产自产拍高清av| 欧美日韩另类在线| 免费成人高清| 最近中文字幕mv在线一区二区三区四区| 亚洲欧美日韩综合aⅴ视频| 午夜精品福利电影| 国产欧美精品日韩精品| 久久久精品一区二区三区| 亚洲第一狼人社区| 麻豆精品视频在线观看| 国产精品久久久久久亚洲毛片| 一本一本久久a久久精品综合妖精 一本一本久久a久久精品综合麻豆 | 亚洲第一久久影院| 亚洲国产岛国毛片在线| 亚洲精品在线免费| 亚洲综合日韩中文字幕v在线| 性色一区二区| 狼人天天伊人久久| 亚洲黄一区二区| 亚洲私人影院在线观看| 久久99在线观看| 蜜月aⅴ免费一区二区三区| 欧美日韩国产成人精品| 国产农村妇女精品| 亚洲电影免费观看高清| 99精品视频免费| 欧美一区二区成人| 亚洲风情亚aⅴ在线发布| 在线一区欧美| 久久久久久久久久久久久久一区 | 久久久国产午夜精品| 欧美jizzhd精品欧美巨大免费| 亚洲三级影片| 亚洲综合色视频| 亚洲欧美日韩中文播放| 欧美大片在线观看一区| 国产精品自拍网站| 亚洲精品自在在线观看| 欧美中文字幕| 日韩亚洲一区二区| 久久婷婷国产综合精品青草| 欧美日韩在线亚洲一区蜜芽| 136国产福利精品导航| 亚洲欧美日韩精品久久亚洲区| 亚洲福利小视频| 先锋影音久久| 国产精品二区在线| 亚洲精选视频在线| 久久亚洲免费| 欧美亚洲三级| 国产精品视频一二| 中文av字幕一区| 亚洲国产精品123| 久久久久久久久一区二区|