diff options
Diffstat (limited to 'doc/development/database')
5 files changed, 18 insertions, 39 deletions
diff --git a/doc/development/database/database_lab.md b/doc/development/database/database_lab.md index 162fc597cc4..e428b9d4b0a 100644 --- a/doc/development/database/database_lab.md +++ b/doc/development/database/database_lab.md @@ -12,6 +12,17 @@ on replicated production data. Unlike a typical read-only production replica, in also create, update, and delete rows. You can also test the performance of schema changes, like additional indexes or columns, in an isolated copy of production data. +## Database Lab quick start + +1. [Visit the console](https://console.postgres.ai/). +1. Select **Sign in with Google**. (Not GitLab, as you need Google SSO to connect with our project.) +1. After you sign in, select the GitLab organization and then visit "Ask Joe" in the sidebar. +1. Select the database you're testing against: + - Most queries for the GitLab project run against `gitlab-production-tunnel-pg12`. + - If the query is for a CI table, select `gitlab-production-ci`. + - If the query is for the container registry, select `gitlab-production-registry`. +1. Type `explain <Query Text>` in the chat box to get a plan. + ## Access Database Lab Engine Access to the DLE is helpful for: @@ -21,7 +32,7 @@ Access to the DLE is helpful for: To access the DLE's services, you can: -- Perform query testing in the `#database_lab` Slack channel, or in the Postgres.ai web console. +- Perform query testing in the Postgres.ai web console. Employees access both services with their GitLab Google account. Query testing provides `EXPLAIN` (analyze, buffers) plans for queries executed there. - Migration testing by triggering a job as a part of a merge request. @@ -40,8 +51,6 @@ This procedure is similar to [Rails console access with Teleport](https://gitlab You can access Database Lab's query analysis features either: -- In the `#database_lab` Slack channel. Shows everyone's commands and results, but - your own commands are still isolated in their own clone. - In [the Postgres.ai web console](https://console.postgres.ai/GitLab/joe-instances). Shows only the commands you run. diff --git a/doc/development/database/database_migration_pipeline.md b/doc/development/database/database_migration_pipeline.md index 06e16b4c7f1..2344ee3f942 100644 --- a/doc/development/database/database_migration_pipeline.md +++ b/doc/development/database/database_migration_pipeline.md @@ -9,7 +9,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w > [Introduced](https://gitlab.com/gitlab-org/database-team/team-tasks/-/issues/171) in GitLab 14.2. With the [automated migration testing pipeline](https://gitlab.com/gitlab-org/database-team/gitlab-com-database-testing) -we can automatically test migrations in a production-like environment (similar to `#database-lab`). +we can automatically test migrations in a production-like environment (using [Database Lab](database_lab.md)). It is based on an [architecture blueprint](../../architecture/blueprints/database_testing/index.md). Migration testing is enabled in the [GitLab project](https://gitlab.com/gitlab-org/gitlab) diff --git a/doc/development/database/database_reviewer_guidelines.md b/doc/development/database/database_reviewer_guidelines.md index aa92134018d..933bbe9c060 100644 --- a/doc/development/database/database_reviewer_guidelines.md +++ b/doc/development/database/database_reviewer_guidelines.md @@ -53,9 +53,8 @@ that require a more in-depth discussion between the database reviewers and maint - [Database Office Hours Agenda](https://docs.google.com/document/d/1wgfmVL30F8SdMg-9yY6Y8djPSxWNvKmhR5XmsvYX1EI/edit). - <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [YouTube playlist with past recordings](https://www.youtube.com/playlist?list=PL05JrBw4t0Kp-kqXeiF7fF7cFYaKtdqXM). -You should also join the [#database-lab](understanding_explain_plans.md#database-lab-engine) -Slack channel and get familiar with how to use Joe, the Slackbot that provides developers -with their own clone of the production database. +Get familiar with using [Database Lab from postgres.ai](database_lab.md), a bot that +provides developers with their own clone of the production database. Understanding and efficiently using `EXPLAIN` plans is at the core of the database review process. The following guides provide a quick introduction and links to follow on more advanced topics: diff --git a/doc/development/database/query_performance.md b/doc/development/database/query_performance.md index 73a6a40f801..10ab726940a 100644 --- a/doc/development/database/query_performance.md +++ b/doc/development/database/query_performance.md @@ -44,7 +44,7 @@ automatically includes these options. If you are making a warm cache query, you see only the `shared hits`. -For example in #database-lab: +For example, using [Database Lab](database_lab.md): ```plaintext Shared buffers: @@ -60,7 +60,7 @@ Buffers: shared hit=7323 If the cache is cold, you also see `reads`. -In #database-lab: +Using [Database Lab](database_lab.md): ```plaintext Shared buffers: diff --git a/doc/development/database/understanding_explain_plans.md b/doc/development/database/understanding_explain_plans.md index 094bd6b346f..560744430f9 100644 --- a/doc/development/database/understanding_explain_plans.md +++ b/doc/development/database/understanding_explain_plans.md @@ -714,8 +714,7 @@ SQL optimization tool - [Joe Bot](https://gitlab.com/postgres-ai/joe). Database Lab Engine provides developers with their own clone of the production database, while Joe Bot helps with exploring execution plans. -Joe Bot is available in the [`#database-lab`](https://gitlab.slack.com/archives/CLJMDRD8C) channel on Slack, -and through its [web interface](https://console.postgres.ai/gitlab/joe-instances). +Joe Bot is available through its [web interface](https://console.postgres.ai/gitlab/joe-instances). With Joe Bot you can execute DDL statements (like creating indexes, tables, and columns) and get query plans for `SELECT`, `UPDATE`, and `DELETE` statements. @@ -792,34 +791,6 @@ Planning time: 0.411 ms Execution time: 0.113 ms ``` -### ChatOps - -GitLab team members can also use our ChatOps solution, available in Slack -using the [`/chatops` slash command](../chatops_on_gitlabcom.md). - -NOTE: -While ChatOps is still available, the recommended way to generate execution plans is to use [Database Lab Engine](#database-lab-engine). - -You can use ChatOps to get a query plan by running the following: - -```sql -/chatops run explain SELECT COUNT(*) FROM projects WHERE visibility_level IN (0, 20) -``` - -Visualising the plan using <https://explain.depesz.com/> is also supported: - -```sql -/chatops run explain --visual SELECT COUNT(*) FROM projects WHERE visibility_level IN (0, 20) -``` - -Quoting the query is not necessary. - -For more information about the available options, run: - -```sql -/chatops run explain --help -``` - ## Further reading A more extensive guide on understanding query plans can be found in |
