Skip to content

Commit ad86a0e

Browse files
authored
Update 0xxx-tekton-results-db-index.md
1 parent cc23514 commit ad86a0e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

teps/0xxx-tekton-results-db-index.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ collaborators: []
3838
<!-- /toc -->
3939

4040
## Summary
41-
TektonResults stores PipelineRuns, TaskRuns, Events as Records. Moreover, these are linked to parent object - PipelineRun or TaskRun via Results Table row.
42-
At present, there are no indexes created for querying these Records/Results. This propose a standard way in which Results can create certain indexes.
41+
TektonResults stores PipelineRuns, TaskRuns, Events as Records. Moreover, these are linked to the parent object - PipelineRun or TaskRun via the `results` Table row.
42+
At present, there are no indexes created for querying these Records/Results. This proposes a standard way in which Tekton Results can create certain indexes.
4343

4444

4545
## Motivation
46-
Different platform have different annotations/labels which they use to filter out records.
47-
Results can't create predefined Indexes. They should be configurable via certain config.
48-
As a single row in Result Table has relation to many rows in Record Table, we should utilize Results Table to generate faster queries.
46+
Different platforms have different annotations/labels which they use to filter out records.
47+
Results can't create predefined Indexes. They should be configurable via certain configs.
48+
As a single row in the `results` Table has a relation to many rows in the `records` Table, we should utilize the `results` Table to generate faster queries.
4949

50-
Results Table row contains annotations and record summary annotations to integrate with different platforms. These platforms can communicate on what labels/annotations to store by these json values to annotation `results.tekton.dev/resultAnnotations` or `results.tekton.dev/recordSummaryAnnotations`. We store these json values as jsonb.
50+
The `results` Table row contains annotations and record summary annotations to integrate with different platforms. These platforms can communicate on what labels/annotations to store by these JSON values to annotation `results.tekton.dev/resultAnnotations` or `results.tekton.dev/recordSummaryAnnotations`. We store these JSON values as JSONB in the annotation or recordSummaryAnnotation column.
5151

5252
Now integrators let's say `workflow` has `components`, `application`
5353

@@ -70,7 +70,7 @@ Listing non-goals helps to focus discussion and make progress.
7070

7171
### Requirements
7272

73-
-JSONB values in Result table to be indexed based on Tekton Results Admin specified configurationn.
73+
-JSONB values in the `results` table to be indexed based on Tekton Results Admin specified configurations.
7474

7575
## Proposal
7676

@@ -86,7 +86,7 @@ Let's say a platform `workflow` creates the following labels on Runs:
8686
`workflow.foo-service/component`
8787
`workflow.bar-service/scenario`
8888

89-
Now these labels and values should also be passed as results annotations so that platform can communicate what value to store in annotations/summary annotations row. Ref: https://github.com/tektoncd/results/pull/426/files
89+
Now these labels and values should also be passed as results annotations so that the platform can communicate what value to store in the annotations/summary annotations row. Ref: https://github.com/tektoncd/results/pull/426/files
9090
```
9191
apiVersion: tekton.dev/v1
9292
kind: PipelineRun
@@ -100,9 +100,9 @@ metadata:
100100
Now, Tekton Results can index all these four values.
101101

102102
One more advantage of having these fields is we don't need to filter out based on `PipelineRun` if platform generates `PipelineRun` and needs to display values from `PipelineRun`.
103-
We can store more relevant but limited amoutn of fields from Run Status or Spec in annotations column of Results Table.
103+
We can store some more relevant but limited number of fields from Run Status or Spec in the annotations column of `results` Table.
104104

105-
Also, making query on Results Table outperforms the query on Records Table because of one to many relations.
105+
Also, even without indexes, making a query on `results` Table outperforms the query on the `records` Table because of one-to-many relations and the `records` table having much more number of rows and data per column.
106106

107107
We have observed in certain productions environment, records rows reaching more than half million for just fifty thousand record. One PipelineRuns having 9 TaskRuns.
108108
A sample of this:
@@ -112,7 +112,7 @@ SELECT count(*) FROM "records" WHERE parent = 'scanner-build'
112112
SELECT count(*) FROM "results" WHERE parent = 'scanner-build'
113113
59101
114114
```
115-
Unless UI want to show TaskRuns, it should only query Results Table.
115+
Unless UI want to show TaskRuns, it should only query the `results` Table.
116116

117117

118118
## Design Evaluation

0 commit comments

Comments
 (0)