Debraj Manna <subharaj.manna@xxxxxxxxx> writes: > What profiling will help in this case? If you're on a reasonably modern Linux platform, I'd try "perf", which is capable of gathering a system-wide profile. Note you will need debug symbols installed for Postgres to get good results from any profiling tool. regards, tom lane