Runbook
Slow Performance due to Full Table Scans on Large PostgreSQL Tables
Back to Runbooks
Overview
This incident type refers to situations where PostgreSQL queries are performing full table scans on large tables, leading to slow performance. This occurs when the database management system has to scan the entire table to locate the required data, which can be a time-consuming process. The issue can arise due to a variety of reasons, such as missing or outdated indexes, complex queries, or inefficient query design. To resolve the issue, optimizing the queries on large tables is necessary.
Parameters
Debug
Check PostgreSQL version
Get list of all tables in the database
Check table size
Check if table has an index
Check query plan for a specific query
Check for long running queries
Repair
Adding appropriate indexes to the large tables can help the database management system locate the required data more efficiently, thereby avoiding full table scans.
Partitioning large tables into smaller ones based on specific criteria, such as date or region, can help to reduce the amount of data scanned.
Learn more
Related Runbooks
Check out these related runbooks to help you debug and resolve similar issues.