Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gitpod-db] add index on workspaceDB.Type Column #8858

Merged
merged 1 commit into from
Mar 17, 2022

Conversation

Pothulapati
Copy link
Contributor

@Pothulapati Pothulapati commented Mar 17, 2022

Description

For Telemetry queries to be less intensive on the CPU, We need to
build Indexes to make the querying faster. This PR creates
a index on the type column for the workspaceDB as
we filter on type=='regular'

Signed-off-by: Tarun Pothulapati [email protected]

Related Issue(s)

Fixes #8638

How to test

After creating the index on prod, The query seems to be faster

mysql> select count(*) from d_b_workspace_instance join d_b_workspace on d_b_workspace_instance.workspaceId = d_b_workspace.id where d_b_workspace.type = 'regular';
+----------+
| count(*) |
+----------+
|  5665695 |
+----------+
1 row in set (11.80 sec)

Release Notes

[gitpod-db] add index on `workspaceDB.Type` Column

Documentation

For Telemetry queries to be less intensive on the CPU, We need to
build Indexes to make the querying faster

Signed-off-by: Tarun Pothulapati <[email protected]>
@Pothulapati Pothulapati requested a review from a team March 17, 2022 11:02
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Mar 17, 2022
@@ -68,6 +68,7 @@ export class DBWorkspace implements Workspace {
})
shareable?: boolean;

@Index("ind_type")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works as expected 👍

@roboquat roboquat merged commit b800a43 into main Mar 17, 2022
@roboquat roboquat deleted the tar/telemetry-db-index branch March 17, 2022 12:11
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Mar 18, 2022
Pothulapati added a commit that referenced this pull request Mar 21, 2022
#8617 disabled the telemetry
fields as those database queries were causing heavy CPU performance.

#8858 fixed that issue by
adding indexes for those queries.

This PR also adds tracing for the telemetry data provider so that we
can also count how long they take usually, and how frequently these
are called.

Signed-off-by: Tarun Pothulapati <[email protected]>
Pothulapati added a commit that referenced this pull request Mar 21, 2022
#8617 disabled the telemetry
fields as those database queries were causing heavy CPU performance.

#8858 fixed that issue by
adding indexes for those queries.

This PR also adds tracing for the telemetry data provider so that we
can also count how long they take usually, and how frequently these
are called.

Signed-off-by: Tarun Pothulapati <[email protected]>
Pothulapati added a commit that referenced this pull request Mar 21, 2022
#8617 disabled the telemetry
fields as those database queries were causing heavy CPU performance.

#8858 fixed that issue by
adding indexes for those queries.

This PR also adds tracing for the telemetry data provider so that we
can also count how long they take usually, and how frequently these
are called.

Signed-off-by: Tarun Pothulapati <[email protected]>
Pothulapati added a commit that referenced this pull request Mar 22, 2022
#8617 disabled the telemetry
fields as those database queries were causing heavy CPU performance.

#8858 fixed that issue by
adding indexes for those queries.

This PR also adds tracing for the telemetry data provider so that we
can also count how long they take usually, and how frequently these
are called.

Signed-off-by: Tarun Pothulapati <[email protected]>
Pothulapati added a commit that referenced this pull request Mar 28, 2022
#8617 disabled the telemetry
fields as those database queries were causing heavy CPU performance.

#8858 fixed that issue by
adding indexes for those queries.

This PR also adds tracing for the telemetry data provider so that we
can also count how long they take usually, and how frequently these
are called.

Signed-off-by: Tarun Pothulapati <[email protected]>
roboquat pushed a commit that referenced this pull request Mar 29, 2022
#8617 disabled the telemetry
fields as those database queries were causing heavy CPU performance.

#8858 fixed that issue by
adding indexes for those queries.

This PR also adds tracing for the telemetry data provider so that we
can also count how long they take usually, and how frequently these
are called.

Signed-off-by: Tarun Pothulapati <[email protected]>
Pothulapati added a commit that referenced this pull request Mar 30, 2022
#8617 disabled the telemetry
fields as those database queries were causing heavy CPU performance.

#8858 fixed that issue by
adding indexes for those queries.

This PR also adds tracing for the telemetry data provider so that we
can also count how long they take usually, and how frequently these
are called.

Signed-off-by: Tarun Pothulapati <[email protected]>
@Pothulapati Pothulapati mentioned this pull request Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note size/S team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[telemetry] Fix telemetry causing high DB CPU load
3 participants