(BThank you for advice.
(BI am going to remake a patch, in order to make it simple.
(BThe plan of a new patch is as follows.
(B(1)Add fields to TupleTableSlot and TupleTableData.
(BThis fields are for holding the tuple disassembly information.
(B(2)Add the codes which initializes/cleans new fields.
(BThese codes are added to execTuples.c.
(B(3)Add two functions to execQual.c.
(BOne function is just like heap_deformtuple. It is given a
(BTupleTableSlot. And it extracts the field of tuple incrementary
(Busing the new fields of TupleTableSlot.
(BThe meaning of incrementary is as the following example.
(BExample: The tupple has 100 columns.
(B - first call to get col5 will fill first 5 positions in the array.
(B - next call to get col75 will fill starts from 5 and up to 75.
(B - next call to get col60 will only refer to array, because
(B already extracted.
(BAnother function is just like heap_getattr and fast_getattr.
(BIt is given a TupleTableSlot. And this function uses new
(Bfunction(like a heap_deformtuple), instead of nocachegetattr.
(B(4)ExecEvalVar uses new function(like a heap_getattr) instead of
(BWith a new patch, only three files of tuptable.h, and execTuple.c
(Band execQual.c are due to be changed.
(B> BTW, why is it that your profile shows *more* calls to
(B> heap_deformtuple_incr after the patch than there were nocachegetattr
(B> calls before?
(BMany one is for printtup.
(B(printtup -> heap_deformtuple -> heap_deformtuple_incr)
(BSince the code of heap_deformtuple and heap_deformtuple_incr has been
(Bshare, heap_deformtuple_incr looks many calls than nocachegetattr.
(BIf a part for the number of calls of heap_deformtuple_incr
(Bby printtup is removed, heap_deformtuple_incr and nocachegetattr
(Bwill be the same number of calls.
(BWith my test being to access the column in ascending order
(B(select t100, t110 ...), heap_deformtuple_incr and nocachegetattr
(Bis the same calls.
(BIf the column is accessed in descending order(select t200, t190...),
(Bnumber of calls of heap_deformtuple_incr will decrease sharply.
(BIt is because a result is cached by the first call to get t200.
(B--- Atsushi Ogawa
(B---------------------------(end of broadcast)---------------------------
(BTIP 8: explain analyze is your friend