blob: c38eff549d317af730616612640ef7ffff7866a2 [file] [log] [blame]
# Datastore Composite Index Configuration.
# https://developers.google.com/appengine/docs/python/config/indexconfig
#
# Below, most indexes come in pairs; one with the internal_only property,
# one without. This is because all queries when the user is not logged in
# have the filter internal_only == False.
#
# Composite index properties must be listed differently depending on how the
# properties are used. There are three main ways to use properties in a query:
# (1) In an equality filter.
# (2) In an inequality filter.
# (3) In a sort order.
# The properties below must be listed in this order. The "direction" only needs
# to be specified for properties used for sort order.
#
# To update the indexes in production after editing them here, you must run
# appcfg.py vacuum_indexes or appcfg.py update_indexes.
indexes:
# Use the zigzag merge join algorithm:
# https://cloud.google.com/appengine/articles/indexselection
# The datastore joins these indexes to support any query that orders by
# -timestamp. These indexes cannot be used for queries that order by a different
# property.
- kind: Anomaly
properties:
- name: internal_only
- name: timestamp
direction: desc
- kind: Anomaly
properties:
- name: bug_id
- name: timestamp
direction: desc
- kind: Anomaly
properties:
- name: sheriff
- name: timestamp
direction: desc
- kind: Anomaly
properties:
- name: is_improvement
- name: timestamp
direction: desc
- kind: Anomaly
properties:
- name: recovered
- name: timestamp
direction: desc
- kind: Anomaly
properties:
- name: test
- name: timestamp
direction: desc
- kind: Anomaly
properties:
- name: master_name
- name: timestamp
direction: desc
- kind: Anomaly
properties:
- name: bot_name
- name: timestamp
direction: desc
- kind: Anomaly
properties:
- name: benchmark_name
- name: timestamp
direction: desc
- kind: Anomaly
properties:
- name: start_revision
- name: timestamp
direction: desc
- kind: Anomaly
properties:
- name: start_revision
direction: desc
- name: timestamp
direction: desc
- kind: Anomaly
properties:
- name: end_revision
- name: timestamp
direction: desc
- kind: Anomaly
properties:
- name: end_revision
direction: desc
- name: timestamp
direction: desc
- kind: Anomaly
properties:
- name: statistic
- name: test
- name: end_revision
direction: desc
# This composite index supports the most important type of query in alerts.py
# when improvements and triaged alerts are not required. Without this index,
# that query would need to merge 4 of the indexes above, which significantly
# impacts performance. When either improvements or triaged alerts are required,
# the datastore only needs to merge 2 or 3 indexes, which is fast enough.
- kind: Anomaly
properties:
- name: sheriff
- name: is_improvement
- name: bug_id
- name: recovered
- name: timestamp
direction: desc
# GetAlertsAroundRevision orders by end_revision instead of timestamp, so it
# can't use the above indexes.
- kind: Anomaly
properties:
- name: internal_only
- name: end_revision
# Used to query for "My Jobs".
- kind: Job
properties:
- name: user
- name: created
direction: desc
# Used in find_anomalies.GetRowsToAnalyze when getting latest points,
# with projection query for properties revision and value.
- kind: Row
properties:
- name: parent_test
- name: revision
direction: desc
- name: value
# Used in graph_revisions.py to do a projection query for timestamp, revision
# and value for points from a particular test.
- kind: Row
properties:
- name: parent_test
- name: revision
- name: timestamp
- name: value
# Used in several modules (graph_json.py and graph_csv.py) to fetch the latest
# points for a test.
- kind: Row
properties:
- name: parent_test
- name: revision
direction: desc
# This composite index enables querying for points for a particular test,
# filtering or sorting by revision. This may be unused, but it may be useful
# for queries on the interactive console.
- kind: Row
properties:
- name: parent_test
- name: revision
# May be unused!
# Likely used in new_points.py to query newest points for a particular test.
# However listing the latest points for a test also works when not logged in
# currently, although there appears to be no index in this file for that.
- kind: Row
properties:
- name: parent_test
- name: timestamp
direction: desc
# Used for returning timeseries of histogram commit records.
- kind: HistogramRevisionRecord
properties:
- name: test
- name: revision
- kind: HistogramRevisionRecord
properties:
- name: test
- name: revision
direction: desc
# Used for returning timeseries of diagnostics.
- kind: SparseDiagnostic
properties:
- name: start_revision
direction: desc
- name: end_revision
direction: desc
- kind: SparseDiagnostic
properties:
- name: start_revision
direction: desc
- name: end_revision
direction: desc
- name: internal_only
- kind: SparseDiagnostic
properties:
- name: test
- name: start_revision
direction: desc
- kind: SparseDiagnostic
properties:
- name: test
- name: end_revision
direction: desc
- kind: SparseDiagnostic
properties:
- name: internal_only
- name: start_revision
direction: desc
# Used in update_test_suites to query keys of test suites (parent_test == None)
# with deprecated and description projection. Two separate lists of
# test suites are kept, one for external and one for internal.
- kind: TestMetadata
properties:
- name: parent_test
- name: deprecated
- name: description
- kind: TestMetadata
properties:
- name: internal_only
- name: parent_test
- name: deprecated
- name: description