...
After you have found the relevant SQL queries performed by the application you can proceed to investigate how PostgreSQL handles them. PostgreSQL provides a way to see the execution plan it creates for a specific query. You can use the EXPLAIN command to examine how the query is run. Note that the query is actually executed against the data so use run it inside a transaction that is cancelled using ROLLBACK if you are analyzing queries that modify data unless you want to permanently persist the changes to the database. So use either:
...