gpt4 book ai didi

google-app-engine - 对于简单和复杂的查询,如何计算数据存储写入操作(写入总数)?

转载 作者:太空宇宙 更新时间:2023-11-03 15:25:04 25 4
gpt4 key购买 nike

我正在使用数据存储开发应用引擎项目(创建我们的数据库),

根据此 link 中提供的信息列出了不同情况(插入、更新和删除)的读写操作总数,但我很困惑如何计算修改索引和复合索引的写操作。

我们有以下案例场景,我们必须计算写入操作的数量

1 >> Datastore 查询需要基于单个属性进行过滤没有复杂的查询[datastore-indexes.xml 文件中没有定义索引]

根据示例 “SELECT * FROM MESSAGE AS MESSAGE ORDER BY timestamp desc”

2>> 数据存储区查询需要基于单个属性进行过滤,没有复杂的查询[在 datastore-indexes.xml 文件中的一个属性上定义的索引]按照示例 “SELECT * FROM MESSAGE AS MESSAGE ORDER BY timestamp desc”

3>> 数据存储查询需要根据复杂查询进行过滤[在datastore-indexes.xml 文件中为复杂查询定义的索引] 根据示例““SELECT * FROM MESSAGE AS MESSAGE WHERE req_id="xyz123"ORDER BY timestamp desc"

Note::for example purpose i have taken this statement “SELECT * FROM MESSAGE AS MESSAGE ORDER BY timestamp desc".This jpql query makes a get(1 read operation) http request in order to retrieve data from datastore.

问题

For above case scenario how New Entity Put write operation will be counted ?[ New Entity Put " 2 writes + 2 writes per indexed property value + 1 write per composite index value"]

提前致谢!!!

最佳答案

对于具有单值属性的实体,编写一个新的实体需要进行以下写入:

  • 1 个实体本身
  • EntitiesByKind 索引为 1
  • 每个索引属性 2
  • 每个复合索引1个

所以对于你的例子:

  1. 1 + 1 + 2*(索引属性的数量)
  2. 这实际上与#1 相同;无需在 datastore-indexes.xml 中定义单一属性索引,因为它们会自动包含在内。
  3. 1 + 1 + 2*(索引属性的数量)+ 1

这是 more information关于 Datastore 写入成本。

关于google-app-engine - 对于简单和复杂的查询,如何计算数据存储写入操作(写入总数)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24524568/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com