Postgres consuming a lot of cpu I have a Java system with Postgres 8.3 and Glassfish application server, from time to time, the application is very slow at certain times - when it has more hits; by the top command, we can see the increase of cpu consumption by the user postgres, in relation to memory the consumption is normal, I've done tunning, I'm logging the queries that take longer to be executed and optimizing, but nothing solved, so I am here asking for your help, who knows and can give me any tips, I thank you in advance.
The fact that 4 out of the 5 queries are in the BIND state make me think you have a problem with probing the endpoints of an index.  This can often be problem if the planner is deciding if it wants to use a merge join.  Note that even if it decides against the merge join, it has still called get_actual_variable_range and if that is slow then it still suffers the slowness. However, I don't think that this mechanism even exists in 8.3.  Is that really what you are running?  If so, you might be better off spending time on getting an upgrade done, rather than trying to tune obsolete software.

One thing to try is to make sure you don't have long running transactions open, and to then vacuum the database.