Step 4: Fetching Currently Running Queries:

ARTIFACTORY : What all information needs to be collected from PostgreSQL when debugging performance related issues in Artifactory

AuthorFullName__c
Vignesh Surendrababu
articleNumber
000005835
ft:sourceType
Salesforce
FirstPublishedDate
2023-08-03T11:32:48Z
lastModifiedDate
2023-08-14T07:58:09Z
VersionNumber
2
When a query prolongs its execution time, it can significantly affect both the database and the overall system performance such as 1) Increased resource consumption 2) Reduced responsiveness 3) Lock contention 4) Increased disk space usage etc.

The following query lists the longest actively running queries. To gather more information about a specific query which is taking a longer time to execute, use EXPLAIN ANALYZE mentioned in step 5
SELECT now() - pg_stat_activity.query_start AS duration, usename, pid, state, query 
FROM pg_stat_activity 
WHERE state != 'idle' 
ORDER BY 1 DESC;