Tuning your PostgreSQL database is somewhat of a black art. While documentation does exist on the topic, many people still find it hard to get all the power out of their system. This article aims to help demystify PostgreSQL database performance tuning.
select min(seq) seq,state,count(*) numb_ops, -> round(sum(duration),5) sum_dur, round(avg(duration),5) avg_dur, -> round(sum(cpu_user),5) sum_cpu, round(avg(cpu_user),5) avg_cpu -> from information_schema.profiling -> where query_id = 7 -> group by state -> order by seq;