Store this object in a table and load it in the function.
Storing it in a Table and accessing the elements by selecting from the Table. This can be a heavy overhead.
While I can’t don’t know for sure how much overhead that is versus launching into tcl, I do avoid creating temporary tables in performance-sensitive code.
Temporary tables in postgresql are pretty fast, last for the duration of the session, and integrate with any procedural language in PG. There's a lot to like there.
One of the problem with temporary tables is that it will result in adding metadata information into PostgreSQL catalog (pg_class), and it will easily get bloated as the temporary table ends its life
11 comments
[ 2.6 ms ] story [ 32.8 ms ] threadAnd also consider multiple parallel connections in a high traffic database creating so many temp tables :(