I am working on the performance problem with the database application.
I've got several PLpgSQL functions that are doing bulk processing of the data.
They are calling some other functions in the loop which, in their own turn, calling third level functions. These, third level functions use some static data.
It is not constant but for for the particular installation it practically never changes. It is currently stored in couple static tables which are used in joins by queries. If I can eliminate these joins, I can shave off 150-170 ms for every query execution which adds up to 2-2.5 minutes for the top level.
If someone know a way to somehow reads this static data into a set of environment variables which can later be used by all underlying functions without passing them in as parameters (there are too many to pass),
please speak up. Your input will be greatly appreciated.