Perf: fields in pg gem causes an allocation, cache it
Perf: avoid array allocation where not needed
Merge pull request #12037 from SamSaffron/mem_alloc

Performance: Reduce memory allocations in Active Record