This document describes how you can use Gemini in Databases assistance to help you monitor and troubleshoot your AlloyDB for PostgreSQL resources.
Before you begin
Ensure that Gemini in Databases is set up for your organization.
Improve query performance
To improve query performance for AlloyDB using Gemini assistance, follow these steps:
- In the Google Cloud console, go to the Clusters page. Go to Clusters
- From the list of clusters and instances, click an instance.
- Click Query Insights.
- Click Executed Queries.
- To open the Gemini pane, click sparkGemini.
- In the Gemini pane, enter a prompt that describes the
information that you're interested in—for example:
- "Summarize database query trends by users."
- "Which of my queries have high latency for this database instance?"
- "What is the slowest query for this database in this instance?"
- "What are the wait times for the query ID = <hash id>> in this database?"
- To send the prompt, click Send. Gemini returns a response to your prompt based on information from the last hour.
Improve system performance
To improve system performance for AlloyDB using Gemini assistance, follow these steps:
- In the Google Cloud console, go to the Clusters page. Go to Clusters
- From the list of clusters and instances, click an instance.
- Click Query Insights.
- To open Gemini, click sparkGemini.
- In the Gemini pane, enter a prompt that describes the
information you're interested in—for example:
- "How many error log entries are there for this database instance?"
- "What was the CPU utilization for this database instance around 2 PM today?"
- "Were there any restarts in the last 7 days for this database?"
- "When was the last instance update event in the last 24 hours for this database?"
- To send the prompt, click Send. Gemini returns a response to your prompt based on information from the last hour.
Improve index usage
To improve index performance for AlloyDB using Gemini assistance, follow these steps:
- In the Google Cloud console, go to the Clusters page. Go to Clusters
- From the list of clusters and instances, click an instance.
- Click Query Insights.
- Click Executed Queries.
- To open Gemini, click spark Gemini.
- In the Gemini pane, enter a prompt that describes the information you're interested in—for example, "What are the top queries that require indexes in my database instance?"
- To send the prompt, click Send. Gemini returns a response to your prompt based on information from the last hour.
Monitor active queries
To improve the performance of active queries for AlloyDB using Gemini assistance, follow these steps:
- In the Google Cloud console, go to the Clusters page. Go to Clusters
- From the list of clusters and instances, click an instance.
- Click Query Insights.
- Click Active Queries.
- To open Gemini, click spark Gemini.
- In the Gemini pane, enter a prompt that describes the
information you're interested in—for example:
- "What are the top queries running for this database instance?"
- "Are there any active queries with transaction duration > 1 min for this database instance"
- To send the prompt, click Send. Gemini returns a response to your prompt based on information from the last hour.
What's next
Learn more about the following: