mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
Move TupleTableSlots boolean member into one flag variable.
There's several reasons for this change: 1) It reduces the total size of TupleTableSlot / reduces alignment padding, making the commonly accessed members fit into a single cacheline (but we currently do not force proper alignment, so that's not yet guaranteed to be helpful) 2) Combining the booleans into a flag allows to combine read/writes from memory. 3) With the upcoming slot abstraction changes, it allows to have core and extended flags, in a memory efficient way. Author: Ashutosh Bapat and Andres Freund Discussion: https://postgr.es/m/20180220224318.gw4oe5jadhpmcdnm@alap3.anarazel.de
This commit is contained in:
@ -1391,7 +1391,7 @@ slot_deform_tuple(TupleTableSlot *slot, int natts)
|
||||
{
|
||||
/* Restore state from previous execution */
|
||||
off = slot->tts_off;
|
||||
slow = slot->tts_slow;
|
||||
slow = TTS_SLOW(slot);
|
||||
}
|
||||
|
||||
tp = (char *) tup + tup->t_hoff;
|
||||
@ -1452,7 +1452,10 @@ slot_deform_tuple(TupleTableSlot *slot, int natts)
|
||||
*/
|
||||
slot->tts_nvalid = attnum;
|
||||
slot->tts_off = off;
|
||||
slot->tts_slow = slow;
|
||||
if (slow)
|
||||
slot->tts_flags |= TTS_FLAG_SLOW;
|
||||
else
|
||||
slot->tts_flags &= ~TTS_FLAG_SLOW;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user