Probably the solution is "don't try to use JSON as temp tables for anything but very small datasets". As you know, I'm converting an application that uses temp tables to NOT use temp tables because it needs to run in a read-only database. JSONB seemed to be the way to go because you can almost treat them the same as temp tables. I think in the end, it will be "fast enough", but just not as fast as temp tables. Thanks for your help!
Basically what I am doing is trying to simulate a SQL UPDATE statement. currently I am doing this, and it works, but it is slow, so I am looking for a better way.
I don't presently know a better solution in PostgreSQL.