Andres Freund wrote: > On 2014-12-09 14:41:46 -0300, Alvaro Herrera wrote: > > So I've been updating my very old patch to allow logical and physical > > column reordering. Here's a WIP first cut for examination. > > Do you have a updated patch that has ripened further?
Not yet. Phil was kind enough to send me his old patch for study; I am stealing a few interesting ideas from there, in particular: > > Another place that needs tweaking is heapam.c, which must construct a > > physical tuple from Datum/nulls arrays (heap_form_tuple). In some cases > > the input arrays are sorted in logical column order. > > I'm not sure that changing heaptuple.c's API (you mean that, not > heapam.c, right?) is a good level to tackle this at. I think some > function to reorder values/isnull arrays into logical order and reverse > might end up being less invasive and actually faster. Phil took a different route here than I did, and I think his design is better than mine. The main idea is that the Datum/nulls arrays in a TupleTableSlot always follows physical order (he calls it "storage order"), rather than this very strange mixture of things I did by hacking the heaptuple.c API. So I'm reworking my patch with that in mind. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers