Star us on Github
Join us on Slack
Start Now
YugabyteDB Managed
Try our fully managed cloud DBaaS for free.
No credit card required
Sign up
YugabyteDB
Try our open source distributed SQL database on your laptop.
Download
Products
YugabyteDB
The open source distributed SQL database
YugabyteDB Anywhere
Self-managed cloud DBaaS
YugabyteDB Managed
Fully managed cloud DBaaS
Integrations
FAQ
Releases
YugabyteDB
YugabyteDB Anywhere
YugabyteDB Managed
YugabyteDB Voyager
v2.17
Preview
v2.18
STS
v2.17
Preview
v2.16
STS
v2.14
LTS
v2.12
v2.8
Unsupported versions
Home
Explore
Query tuning
Query Tuning
Tuning and optimizing query performance
Contribute
Report a doc issue
Suggest new content
Edit this page
Contributor guide
Introduction
Tune and optimize query performance in YugabyteDB.
Get query statistics using pg_stat_statements
Track planning and execution statistics for all SQL statements executed by a server.
View live queries with pg_stat_activity
Troubleshoot problems and identify long-running queries with the activity view.
View terminated queries with yb_terminated_queries
Identify terminated queries with the get queries function.
View COPY status with pg_stat_progress_copy
Get the COPY command status, number of tuples processed, and other COPY progress reports with this view.
View CREATE INDEX status with pg_stat_progress_create_index
Get the CREATE INDEX command status, including the status of an ongoing concurrent index backfill, and the index build's progress reports.
Analyze queries with EXPLAIN
Tune your queries by creating and analyzing execution plans.
Optimize YSQL queries using pg_hint_plan
Control query execution plans with hinting phrases.