docs: explain `ChunkOrder` query test scenario

pull/24376/head
Marco Neumann 2021-09-10 09:25:03 +02:00
parent c28f38309a
commit 9a60af7fa3
1 changed files with 15 additions and 0 deletions

View File

@ -1170,6 +1170,21 @@ impl DbSetup for ChunkOrder {
.clear_lifecycle_action()
.unwrap();
// Now we have the the following chunks (same partition and table):
//
// | ID | order | tag: region | field: user | time |
// | -- | ----- | ----------- | ----------- | ---- |
// | 1 | 1 | "west" | 2 | 100 |
// | 2 | 0 | "west" | 1 | 100 |
//
// The result after deduplication should be:
//
// | tag: region | field: user | time |
// | ----------- | ----------- | ---- |
// | "west" | 2 | 100 |
//
// So the query engine must use `order` as a primary key to sort chunks, NOT `id`.
let scenario = DbScenario {
scenario_name: "chunks where chunk ID alone cannot be used for ordering".into(),
db,