News for hackers. Stuff that matters.
Re:Global Associative Arrays in PostgreSQL by phibz on Sunday February 28, 2021 @10:46PM (#26299518)
Couldn't you just use a temporary table?
Re:Global Associative Arrays in PostgreSQL by zeroimpl on Sunday February 28, 2021 @10:55PM (#26299555)
That was option #3:

    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.
Re:Global Associative Arrays in PostgreSQL by avi_vallarapu on Monday March 01, 2021 @07:26AM (#26302103)
Yes, TCL seems to be ultra fast in comparison. And it is good to avoid temporary tables when performance is the major criteria
Re:Global Associative Arrays in PostgreSQL by phibz on Monday March 01, 2021 @08:19PM (#26310773)
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.
Re:Global Associative Arrays in PostgreSQL by avi_vallarapu on Monday March 01, 2021 @07:25AM (#26302094)
There exists a great difference in performance between creating a temp table to store the information vs using associative arrays.

And also consider multiple parallel connections in a high traffic database creating so many temp tables :(

Re:Global Associative Arrays in PostgreSQL by jobinau on Monday March 01, 2021 @08:14AM (#26302426)
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