久久久久久久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的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我有一個 dynamodb 表來存儲電子郵件屬性信息.我在電子郵件上有一個哈希鍵,在時間戳(數字)上有一個范圍鍵.使用電子郵件作為哈希鍵的最初想法是按電子郵件查詢所有電子郵件.但我想做的一件事是檢索所有電子郵件 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.

                我當前提取 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']) 
                

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

                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 掃描,您需要在客戶端過濾掉重復項(在您的情況下,使用 boto).即使您使用反向架構創建 GSI,您仍然會得到重復項.給定一個名為 stamped_emails 的 email_id+timestamp 的 H+R 表,所有唯一 email_ids 的列表是 H+R stamped_emails 表的物化視圖.您可以啟用 DynamoDB Stream 在 stamped_emails 表上,訂閱 Lambda 函數對 stamped_emails 的 Stream 執行 PutItem (email_id) 到名為 emails_only 的僅哈希表.然后,您可以 Scan emails_only 并且不會收到重復郵件.

                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.

                最后,關于您關于成本的問題,即使您只請求這些項目的某些預計屬性,Scan 也會讀取整個項目.其次,Scan 必須通讀每個項目,即使它被 FilterExpression(條件表達式)過濾掉.第三,掃描順序讀取項目.這意味著為了計量目的,每個掃描調用都被視為一次大讀取.這樣做的成本含義是,如果一個 Scan 調用讀取 200 個不同的項目,它不一定會花費 100 個 RCU.如果每個項目的大小為 100 字節,則該 Scan 調用將花費 ROUND_UP((20000 字節/1024 kb/字節)/8 kb/EC RCU) = 3 RCU.即使此調用僅返回 123 個項目,如果 Scan 必須讀取 200 個項目,在這種情況下您將產生 3 個 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.

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

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

                相關文檔推薦

                python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個模塊和類)
                Configuring Python to use additional locations for site-packages(配置 Python 以使用站點包的其他位置)
                How to structure python packages without repeating top level name for import(如何在不重復導入頂級名稱的情況下構造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(分發帶有已編譯動態共享庫的 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>
                          主站蜘蛛池模板: 亚洲日日操| 日本中文在线 | 亚洲精品小视频在线观看 | 欧美精品1区2区3区 免费黄篇 | 欧美国产视频 | 男女羞羞的网站 | 欧美一区二区三区视频在线观看 | 天天久久| 另类视频在线 | 国产一区二区三区四区 | 国产亚洲网站 | 成人在线看片 | 国产欧美精品一区二区色综合 | 国产伦精品 | 黄色av免费 | 中文字幕亚洲一区二区三区 | 91久久久久久久久久久久久 | 精品久久久久香蕉网 | 丁香婷婷久久久综合精品国产 | 日韩在线视频免费观看 | 国产精品视频网址 | www.一区二区三区 | 最近日韩中文字幕 | 特级黄一级播放 | 粉嫩av在线 | 日本一二三区高清 | 国产精品久久久久一区二区三区 | 亚洲精品久久久一区二区三区 | 国产欧美一区二区三区久久手机版 | 亚洲www. | 亚洲精品中文在线观看 | 色偷偷888欧美精品久久久 | 中文字幕免费 | 国产免费观看一级国产 | 欧美在线国产精品 | 久久久久久久久久久久久91 | 一区二区三区四区电影 | 天天干免费视频 | 久久精品欧美一区二区三区麻豆 | 国产成人精品免高潮在线观看 | 欧美一区二区三区的 |