【问题标题】:index.yaml is not updatingindex.yaml 未更新
【发布时间】:2011-03-06 01:34:34
【问题描述】:

当我在开发环境中运行查询时,我希望 index.yaml 文件能够使用必要的索引进行更新。它声称它正在更新开发服务器日志中的这个文件,但该文件实际上并没有改变。知道会发生什么吗?

这是整个 index.yaml 文件:

indexes:

# AUTOGENERATED

# This index.yaml is automatically updated whenever the dev_appserver
# detects that a new type of query is run.  If you want to manage the
# index.yaml file manually, remove the above marker line (the line
# saying "# AUTOGENERATED").  If you want to manage some indexes
# manually, move them above the marker line.  The index.yaml file is
# automatically uploaded to the admin console when you next deploy
# your application using appcfg.py.

日志在我希望它添加新索引的地方有几行:

INFO     2010-06-20 18:56:23,957 dev_appserver_index.py:205] Updating C:\photohuntservice\main\index.yaml

不确定它是否重要,但我使用的是 AppEngine SDK 1.3.4 版。

【问题讨论】:

    标签: google-app-engine yaml


    【解决方案1】:

    您确定正在运行需要构建复合索引的查询吗?单个属性上的任何查询都将使用默认索引提供服务,并且不需要 index.yaml 条目,并且仅在多个属性上使用相等过滤器的任何查询都将使用不需要的合并连接策略执行构建自定义索引。

    除非您在生产中抛出 NeedIndexErrors(没有关于现有索引不允许查询足够有效运行的消息),否则您的空 index.yaml 可能会非常好。

    【讨论】:

    • 当我使用 GeoModel 进行邻近查询时,我得到的是长查询。这不是一个硬故障,只是一个缓慢的查询。我怀疑缺少索引可能是罪魁祸首,因为我没有任何索引。也许这是 GeoModel 本身的一个缺陷......(我的 DataStore 中有几百个项目。实际上没有查询应该很慢。)
    • @Joe dev_appserver 上的性能并不代表实时服务器上的性能 - SDK 上的慢查询可能不在生产环境中。您需要向我们展示您正在执行的查询类型的示例,以便我们判断它是否应该生成索引。
    【解决方案2】:

    an issue Linux 上的 Python SDK 不会重新生成在 Windows 上创建的index.yaml。这可能与您的情况有关,但似乎您在 SDK 中并没有真正创建 queries that cause automatic index

    【讨论】:

    • 谢谢。 Linux 上似乎也是如此(Python SDK)。删除了文件,它工作得很好;)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-09
    • 1970-01-01
    • 1970-01-01
    • 2014-03-30
    • 2017-04-10
    相关资源
    最近更新 更多