I think I found the problem. I was comparing wrongly some values and based on that, every time the script was run (that means once every 5 minutes) my script deleted two tables and populated them with about 70 thousand records. I still don't know why that affected the speed of the database (even when the script was not running) and how to fix it. I have a script that vacuums full and reindexes the database every day. Is there something else I must do? ------------------------- E-Mail powered by MadNet. http://www.madnet.ro/ ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org