rethinkdbdash icon indicating copy to clipboard operation
rethinkdbdash copied to clipboard

Prod mode

Open neumino opened this issue 11 years ago • 1 comments

The drive should have two mode, prod and dev (which we should be able to set per query in run). In prod, these queries should print a warning (the first time) and suggest to use an index.

r.table("posts").orderBy("field")
r.table("posts").filter({field: "value"})
r.table("posts").group("date")

The question are:

  • What the default should be?
  • Can we catch some filter that should be between too?

Note: Accidentally opened on rethinkdb -_- https://github.com/rethinkdb/rethinkdb/issues/3247

neumino avatar Oct 26 '14 04:10 neumino

Perhaps in addition to printing a warning, these stats could be accumulated internally and you could retrieve them later via something like rethinkdbdash.report(). This would allow you to run tests, for example, and then assert that indexes were used appropriately.

[
  {
    "table": <table_name>,
    "queries": <count>,
    "index_hit": {
      "field": <count>,
      "date": <count>
    },
    "index_miss": {
      "field": <count>,
      "date": <count>
    }
  },
  ...
]

marshall007 avatar Dec 04 '14 05:12 marshall007