You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: teps/0xxx-tekton-results-db-index.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,16 +38,16 @@ collaborators: []
38
38
<!-- /toc -->
39
39
40
40
## 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.
43
43
44
44
45
45
## 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.
49
49
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.
51
51
52
52
Now integrators let's say `workflow` has `components`, `application`
53
53
@@ -70,7 +70,7 @@ Listing non-goals helps to focus discussion and make progress.
70
70
71
71
### Requirements
72
72
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.
74
74
75
75
## Proposal
76
76
@@ -86,7 +86,7 @@ Let's say a platform `workflow` creates the following labels on Runs:
86
86
`workflow.foo-service/component`
87
87
`workflow.bar-service/scenario`
88
88
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
90
90
```
91
91
apiVersion: tekton.dev/v1
92
92
kind: PipelineRun
@@ -100,9 +100,9 @@ metadata:
100
100
Now, Tekton Results can index all these four values.
101
101
102
102
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.
104
104
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.
106
106
107
107
We have observed in certain productions environment, records rows reaching more than half million for just fifty thousand record. One PipelineRuns having 9 TaskRuns.
108
108
A sample of this:
@@ -112,7 +112,7 @@ SELECT count(*) FROM "records" WHERE parent = 'scanner-build'
112
112
SELECT count(*) FROM "results" WHERE parent = 'scanner-build'
113
113
59101
114
114
```
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.
0 commit comments