Locate the delay before choosing a fix
To diagnose a slow PostgreSQL query, connect one slow customer action to its database operation and inspect what happens during the delay. Compare the query plan with evidence of execution or waiting, using representative inputs and concurrent work. Choose a change only when those observations support it, then check both elapsed time and the result the customer receives.

