Re: Cache last known per-tuple offsets to speed long tuple
| От | a_ogawa |
|---|---|
| Тема | Re: Cache last known per-tuple offsets to speed long tuple |
| Дата | |
| Msg-id | PIEMIKOOMKNIJLLLBCBBAELPCCAA.a_ogawa@hi-ho.ne.jp обсуждение исходный текст |
| Ответ на | Re: Cache last known per-tuple offsets to speed long tuple access (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-patches |
Thank you for advice. I am going to remake a patch, in order to make it simple. The plan of a new patch is as follows. (1)Add fields to TupleTableSlot and TupleTableData. This fields are for holding the tuple disassembly information. (2)Add the codes which initializes/cleans new fields. These codes are added to execTuples.c. (3)Add two functions to execQual.c. One function is just like heap_deformtuple. It is given a TupleTableSlot. And it extracts the field of tuple incrementary using the new fields of TupleTableSlot. The meaning of incrementary is as the following example. Example: The tupple has 100 columns. - first call to get col5 will fill first 5 positions in the array. - next call to get col75 will fill starts from 5 and up to 75. - next call to get col60 will only refer to array, because already extracted. Another function is just like heap_getattr and fast_getattr. It is given a TupleTableSlot. And this function uses new function(like a heap_deformtuple), instead of nocachegetattr. (4)ExecEvalVar uses new function(like a heap_getattr) instead of heap_getattr. With a new patch, only three files of tuptable.h, and execTuple.c and execQual.c are due to be changed. > BTW, why is it that your profile shows *more* calls to > heap_deformtuple_incr after the patch than there were nocachegetattr > calls before? Many one is for printtup. (printtup -> heap_deformtuple -> heap_deformtuple_incr) Since the code of heap_deformtuple and heap_deformtuple_incr has been share, heap_deformtuple_incr looks many calls than nocachegetattr. If a part for the number of calls of heap_deformtuple_incr by printtup is removed, heap_deformtuple_incr and nocachegetattr will be the same number of calls. With my test being to access the column in ascending order (select t100, t110 ...), heap_deformtuple_incr and nocachegetattr is the same calls. If the column is accessed in descending order(select t200, t190...), number of calls of heap_deformtuple_incr will decrease sharply. It is because a result is cached by the first call to get t200. regards, --- Atsushi Ogawa a_ogawa@hi-ho.ne.jp
В списке pgsql-patches по дате отправления: