久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='cs3Up'><style id='cs3Up'><dir id='cs3Up'><q id='cs3Up'></q></dir></style></legend>

    <tfoot id='cs3Up'></tfoot>
    1. <i id='cs3Up'><tr id='cs3Up'><dt id='cs3Up'><q id='cs3Up'><span id='cs3Up'><b id='cs3Up'><form id='cs3Up'><ins id='cs3Up'></ins><ul id='cs3Up'></ul><sub id='cs3Up'></sub></form><legend id='cs3Up'></legend><bdo id='cs3Up'><pre id='cs3Up'><center id='cs3Up'></center></pre></bdo></b><th id='cs3Up'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='cs3Up'><tfoot id='cs3Up'></tfoot><dl id='cs3Up'><fieldset id='cs3Up'></fieldset></dl></div>

        <bdo id='cs3Up'></bdo><ul id='cs3Up'></ul>
    2. <small id='cs3Up'></small><noframes id='cs3Up'>

      從哈希鍵中檢索不同的值 - DynamoDB

      Retrieve distinct values from the hash key - DynamoDB(從哈希鍵中檢索不同的值 - DynamoDB)
    3. <tfoot id='kp3rS'></tfoot>

        <legend id='kp3rS'><style id='kp3rS'><dir id='kp3rS'><q id='kp3rS'></q></dir></style></legend>

            <tbody id='kp3rS'></tbody>

        • <i id='kp3rS'><tr id='kp3rS'><dt id='kp3rS'><q id='kp3rS'><span id='kp3rS'><b id='kp3rS'><form id='kp3rS'><ins id='kp3rS'></ins><ul id='kp3rS'></ul><sub id='kp3rS'></sub></form><legend id='kp3rS'></legend><bdo id='kp3rS'><pre id='kp3rS'><center id='kp3rS'></center></pre></bdo></b><th id='kp3rS'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='kp3rS'><tfoot id='kp3rS'></tfoot><dl id='kp3rS'><fieldset id='kp3rS'></fieldset></dl></div>
            <bdo id='kp3rS'></bdo><ul id='kp3rS'></ul>

            <small id='kp3rS'></small><noframes id='kp3rS'>

              • 本文介紹了從哈希鍵中檢索不同的值 - DynamoDB的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                我有一個(gè) dynamodb 表來(lái)存儲(chǔ)電子郵件屬性信息.我在電子郵件上有一個(gè)哈希鍵,在時(shí)間戳(數(shù)字)上有一個(gè)范圍鍵.使用電子郵件作為哈希鍵的最初想法是按電子郵件查詢(xún)所有電子郵件.但我想做的一件事是檢索所有電子郵件 ID(在哈希鍵中).我為此使用 boto,但我不確定如何檢索不同的電子郵件 ID.

                I have a dynamodb table to store email attribute information. I have a hash key on the email, range key on timestamp(number). The initial idea for using email as hash key is to query all emails by per email. But one thing I trying to do is retrieve all email ids(in hash key). I am using boto for this, but I am unsure as to how to retrieve distinct email ids.

                我當(dāng)前提取 10,000 條電子郵件記錄的代碼是

                My current code to pull 10,000 email records is

                conn=boto.dynamodb2.connect_to_region('us-west-2')
                email_attributes = Table('email_attributes', connection=conn)
                s = email_attributes.scan(limit=10000,attributes=['email']) 
                

                但是要檢索不同的記錄,我必須進(jìn)行全表掃描,然后在代碼中選擇不同的記錄.我的另一個(gè)想法是維護(hù)另一個(gè)表,該表將僅存儲(chǔ)這些電子郵件并進(jìn)行條件寫(xiě)入以查看電子郵件 ID 是否存在,如果不存在則寫(xiě)入.但是我正在嘗試考慮這是否會(huì)更昂貴,并且會(huì)是有條件的寫(xiě)入.

                But to retrieve the distinct records, I will have to do a full table scan and then pick the distinct records in the code. Another idea that I have is to maintain another table that will just store these emails and do conditional writes to see if an email id exists, if not then write. But I am trying to think if this will be more expensive and it will be a conditional write.

                Q1.) Is there a way to retrieve distinct records using a DynamoDB scan?
                Q2.) Is there a good way to calculate the cost per query?
                

                推薦答案

                使用 DynamoDB 掃描,您需要在客戶(hù)端過(guò)濾掉重復(fù)項(xiàng)(在您的情況下,使用 boto).即使您使用反向架構(gòu)創(chuàng)建 GSI,您仍然會(huì)得到重復(fù)項(xiàng).給定一個(gè)名為 stamped_emails 的 email_id+timestamp 的 H+R 表,所有唯一 email_ids 的列表是 H+R stamped_emails 表的物化視圖.您可以啟用 DynamoDB Stream 在 stamped_emails 表上,訂閱 Lambda 函數(shù)對(duì) stamped_emails 的 Stream 執(zhí)行 PutItem (email_id) 到名為 emails_only 的僅哈希表.然后,您可以 Scan emails_only 并且不會(huì)收到重復(fù)郵件.

                Using a DynamoDB Scan, you would need to filter out duplicates on the client side (in your case, using boto). Even if you create a GSI with the reverse schema, you will still get duplicates. Given a H+R table of email_id+timestamp called stamped_emails, a list of all unique email_ids is a materialized view of the H+R stamped_emails table. You could enable a DynamoDB Stream on the stamped_emails table, subscribe a Lambda function to stamped_emails' Stream that does a PutItem (email_id) to a Hash-only table called emails_only. Then, you could Scan emails_only and you would get no duplicates.

                最后,關(guān)于您關(guān)于成本的問(wèn)題,即使您只請(qǐng)求這些項(xiàng)目的某些預(yù)計(jì)屬性,Scan 也會(huì)讀取整個(gè)項(xiàng)目.其次,Scan 必須通讀每個(gè)項(xiàng)目,即使它被 FilterExpression(條件表達(dá)式)過(guò)濾掉.第三,掃描順序讀取項(xiàng)目.這意味著為了計(jì)量目的,每個(gè)掃描調(diào)用都被視為一次大讀取.這樣做的成本含義是,如果一個(gè) Scan 調(diào)用讀取 200 個(gè)不同的項(xiàng)目,它不一定會(huì)花費(fèi) 100 個(gè) RCU.如果每個(gè)項(xiàng)目的大小為 100 字節(jié),則該 Scan 調(diào)用將花費(fèi) ROUND_UP((20000 字節(jié)/1024 kb/字節(jié))/8 kb/EC RCU) = 3 RCU.即使此調(diào)用僅返回 123 個(gè)項(xiàng)目,如果 Scan 必須讀取 200 個(gè)項(xiàng)目,在這種情況下您將產(chǎn)生 3 個(gè) RCU.

                Finally, regarding your question about cost, Scan will read entire items even if you only request certain projected attributes from those items. Second, Scan has to read through every item, even if it is filtered out by a FilterExpression (Condition Expression). Third, Scan reads through items sequentially. That means that each scan call is treated as one big read for metering purposes. The cost implication of this is that if a Scan call reads 200 different items, it will not necessarily cost 100 RCU. If the size of each of those items is 100 bytes, that Scan call will cost ROUND_UP((20000 bytes / 1024 kb/byte) / 8 kb / EC RCU) = 3 RCU. Even if this call only returns 123 items, if the Scan had to read 200 items, you would incur 3 RCU in this situation.

                這篇關(guān)于從哈希鍵中檢索不同的值 - DynamoDB的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個(gè)模塊和類(lèi))
                Configuring Python to use additional locations for site-packages(配置 Python 以使用站點(diǎn)包的其他位置)
                How to structure python packages without repeating top level name for import(如何在不重復(fù)導(dǎo)入頂級(jí)名稱(chēng)的情況下構(gòu)造python包)
                Install python packages on OpenShift(在 OpenShift 上安裝 python 包)
                How to refresh sys.path?(如何刷新 sys.path?)
                Distribute a Python package with a compiled dynamic shared library(分發(fā)帶有已編譯動(dòng)態(tài)共享庫(kù)的 Python 包)

                    <tbody id='eHSkG'></tbody>
                  • <bdo id='eHSkG'></bdo><ul id='eHSkG'></ul>

                  • <tfoot id='eHSkG'></tfoot>
                    <i id='eHSkG'><tr id='eHSkG'><dt id='eHSkG'><q id='eHSkG'><span id='eHSkG'><b id='eHSkG'><form id='eHSkG'><ins id='eHSkG'></ins><ul id='eHSkG'></ul><sub id='eHSkG'></sub></form><legend id='eHSkG'></legend><bdo id='eHSkG'><pre id='eHSkG'><center id='eHSkG'></center></pre></bdo></b><th id='eHSkG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='eHSkG'><tfoot id='eHSkG'></tfoot><dl id='eHSkG'><fieldset id='eHSkG'></fieldset></dl></div>

                      <small id='eHSkG'></small><noframes id='eHSkG'>

                        • <legend id='eHSkG'><style id='eHSkG'><dir id='eHSkG'><q id='eHSkG'></q></dir></style></legend>
                          主站蜘蛛池模板: 五月天婷婷丁香 | 福利视频网站 | 一级片在线观看视频 | 国产视频一区在线 | 国产日韩欧美日韩大片 | 在线观看的av网站 | 日韩三级久久 | 久久a级片 | 成人在线免费网站 | 人人干人人爽 | 亚洲一区二区三区在线视频 | 免费av片 | 欧美国产激情 | 午夜影院在线 | 国产午夜一区二区 | 欧美日韩国产在线 | 成人国产综合 | 国产成人免费在线视频 | 日日干夜夜爽 | 免费特级毛片 | 18成人免费观看网站 | 日韩一区在线视频 | 欧美一二三 | 欧美色图在线视频 | 色综合天天综合网国产成人网 | 亚洲精品久 | 亚洲国产精品一区二区三区 | 黄色片视频在线观看 | h片免费 | 91精品在线免费观看 | 国产激情久久 | 国产免费久久 | 黄色网页在线 | 国产做受入口竹菊 | 久久亚洲免费视频 | 久久艳片www.17c.com| 成人在线网 | 免费黄色小网站 | 国产无精乱码一区二区三区 | 免费在线黄色网址 | av综合网站 |