Cosmos DB query editor and RU cost

Write Cosmos DB SQL with autocomplete, see RU and index metrics for each run, cap the cost, and read the change feed.

Cosmos DB has no separate console in Tablyne. The SQL query is the text of the container tab. The editor knows the Cosmos DB SQL dialect, with highlighting, autocomplete and a run shortcut. There is no formatter yet, and the editor runs one query at a time.

The NoSQL API runs SELECT only. If you try something else, Tablyne explains that documents are written through the grid and the review step.

Each run has a partition key box. Enter the value and the query stays in one partition. If you leave it empty, Tablyne asks you to choose: provide the key, which is cheaper, or turn on “All partitions” for that run only. The service cannot combine some operations across partitions by itself. For several of them, such as ORDER BY, TOP and certain aggregates, Tablyne combines the partial results, which takes more requests and more RU. Where it cannot, it asks for the partition key.

The bottom bar shows the RU for the whole query as a minimum, and why the read stopped. Reasons include the end of results, a full page, the RU ceiling and a deadline. The query metrics panel shows the RU of the last response, documents read against documents returned, the index hit ratio, and server time. If far more documents were read than returned, the panel suggests checking the indexing policy. The local emulator does not compute these metrics, and the panel says so.

Pages continue from a token that Tablyne keeps. Between pages, documents that were deleted or reinserted may be missing or repeated. The screen warns you about this.

Counting uses RU in proportion to the container size, so Tablyne asks before it runs a count.

The change feed panel reads what changed in a container, from the beginning or from now. It keeps the position per partition. It is read-only, and deletes do not appear in a change feed.