This script is useful for what are the query is running more than ‘x’ minutes(your input values) and that query status,you can list out the query as per your timing and query status bash-4.1$ cat bash-4.1$ HOSTNAME=`hostname` PSQL=”/opt/PostgreSQL/9.3/bin/psql” PORT=5432 HOST=”localhost” …
This script is mostly used for will display what are the postgresql query is running more than one minutes and it will display query with PID using this PID you can kill what query is taken more CPU utilization and …
1. Avoid join if possible use subquery instead of join Note : subqueries can be slower than LEFT [OUTER] JOINS, but in my opinion their strength is slightly higher readability. select GPA from Student where sID in (select sID from Apply …