pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<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="a0iso0q" 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="emoeic0" 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的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我有一個(gè) dynamodb 表來存儲(chǔ)電子郵件屬性信息.我在電子郵件上有一個(gè)哈希鍵,在時(shí)間戳(數(shù)字)上有一個(gè)范圍鍵.使用電子郵件作為哈希鍵的最初想法是按電子郵件查詢所有電子郵件.但我想做的一件事是檢索所有電子郵件 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)行條件寫入以查看電子郵件 ID 是否存在,如果不存在則寫入.但是我正在嘗試考慮這是否會(huì)更昂貴,并且會(huì)是有條件的寫入.

                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 掃描,您需要在客戶端過濾掉重復(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ù)對 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)于成本的問題,即使您只請求這些項(xiàng)目的某些預(yù)計(jì)屬性,Scan 也會(huì)讀取整個(gè)項(xiàng)目.其次,Scan 必須通讀每個(gè)項(xiàng)目,即使它被 FilterExpression(條件表達(dá)式)過濾掉.第三,掃描順序讀取項(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的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關(guān)文檔推薦

                python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個(gè)模塊和類)
                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í)名稱的情況下構(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)共享庫的 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="iykqc00" 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>
                          主站蜘蛛池模板: 振动筛-交叉筛-螺旋筛-滚轴筛-正弦筛-方形摇摆筛「新乡振动筛厂家」 | 移动厕所租赁|移动卫生间|上海移动厕所租赁-家瑞租赁 | 同学聚会纪念册制作_毕业相册制作-成都顺时针宣传画册设计公司 | 科威信洗净科技,碳氢清洗机,超声波清洗机,真空碳氢清洗机 | ALC墙板_ALC轻质隔墙板_隔音防火墙板_轻质隔墙材料-湖北博悦佳 | 气力输送_输送机械_自动化配料系统_负压吸送_制造主力军江苏高达智能装备有限公司! | 广东恩亿梯电源有限公司【官网】_UPS不间断电源|EPS应急电源|模块化机房|电动汽车充电桩_UPS电源厂家(恩亿梯UPS电源,UPS不间断电源,不间断电源UPS) | 热镀锌槽钢|角钢|工字钢|圆钢|H型钢|扁钢|花纹板-天津千百顺钢铁贸易有限公司 | 伟秀电气有限公司-10kv高低压开关柜-高低压配电柜-中置柜-充气柜-欧式箱变-高压真空断路器厂家 | 搅拌磨|搅拌球磨机|循环磨|循环球磨机-无锡市少宏粉体科技有限公司 | 钢衬四氟管道_钢衬四氟直管_聚四氟乙烯衬里管件_聚四氟乙烯衬里管道-沧州汇霖管道科技有限公司 | 大型多片锯,圆木多片锯,方木多片锯,板材多片锯-祥富机械有限公司 | 帽子厂家_帽子工厂_帽子定做_义乌帽厂_帽厂_制帽厂_帽子厂_浙江高普制帽厂 | 窖井盖锯圆机_锯圆机金刚石锯片-无锡茂达金刚石有限公司 | 缓蚀除垢剂_循环水阻垢剂_反渗透锅炉阻垢剂_有机硫化物-郑州威大水处理材料有限公司 | 无味渗透剂,泡沫抑尘剂,烷基糖苷-威海威能化工有限公司 | 电机铸铝配件_汽车压铸铝合金件_发动机压铸件_青岛颖圣赫机械有限公司 | 气力输送设备_料封泵_仓泵_散装机_气化板_压力释放阀-河南锐驰机械设备有限公司 | 深圳法律咨询【24小时在线】深圳律师咨询免费 | 不锈钢散热器,冷却翅片管散热器厂家-无锡市烨晟化工装备科技有限公司 | 304不锈钢无缝管_不锈钢管厂家 - 隆达钢业集团有限公司 | ZHZ8耐压测试仪-上海胜绪电气有限公司 | 苏州西朗门业-欧盟CE|莱茵UL双认证的快速卷帘门品牌厂家 | 波纹补偿器_不锈钢波纹补偿器_巩义市润达管道设备制造有限公司 | 铝单板_铝窗花_铝单板厂家_氟碳包柱铝单板批发价格-佛山科阳金属 | 钢丝绳探伤仪-钢丝绳检测仪-钢丝绳探伤设备-洛阳泰斯特探伤技术有限公司 | 广东燎了网络科技有限公司官网-网站建设-珠海网络推广-高端营销型外贸网站建设-珠海专业h5建站公司「了了网」 | 工业机械三维动画制作 环保设备原理三维演示动画 自动化装配产线三维动画制作公司-南京燃动数字 聚合氯化铝_喷雾聚氯化铝_聚合氯化铝铁厂家_郑州亿升化工有限公司 | 深圳天际源广告-形象堆头,企业文化墙,喷绘,门头招牌设计制作专家 | 众能联合-提供高空车_升降机_吊车_挖机等一站工程设备租赁 | ASA膜,ASA共挤料,篷布色母料-青岛未来化学有限公司 | 爆炸冲击传感器-无线遥测传感器-航天星百科 | 洛阳网站建设_洛阳网站优化_网站建设平台_洛阳香河网络科技有限公司 | 定做大型恒温循环水浴槽-工业用不锈钢恒温水箱-大容量低温恒温水槽-常州精达仪器 | 震动筛选机|震动分筛机|筛粉机|振筛机|振荡筛-振动筛分设备专业生产厂家高服机械 | 精益专家 - 设备管理软件|HSE管理系统|设备管理系统|EHS安全管理系统 | 杭州货架订做_组合货架公司_货位式货架_贯通式_重型仓储_工厂货架_货架销售厂家_杭州永诚货架有限公司 | 防水套管厂家-柔性防水套管-不锈钢|刚性防水套管-天翔管道 | 接地电阻测试仪[厂家直销]_电缆故障测试仪[精准定位]_耐压测试仪-武汉南电至诚电力设备 | 开云(中国)Kaiyun·官方网站 - 登录入口 | 富森高压水枪-柴油驱动-养殖场高压清洗机-山东龙腾环保科技有限公司 |