I have developed one function in my PostgreSQL database. It was taking 12-15 seconds to execute.

Now I have restored a new PostgreSQL 9.0 dump using following command:

pg_restore -hx.x.x.x -p5432 -d xxx -Ux -Fc -v </path/pgbackup.backup

but on this newly restored database it takes 2 minutes to execute same function.

Please give me possible way to sort out this problem.

  • 1
    How did you take the backup? Are indexes also recreated? Also, what does your function do? Is there a part you suspect being slow (like a select from a table or the like)? – dezso Sep 4 '13 at 8:09
  • 1
    Run ANALYZE and try again. – MatheusOl Sep 5 '13 at 1:03
  • Please post EXPLAIN ANALYZE output so we can see the query plan used. – Chris Travers Nov 13 '13 at 6:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.