Re: "type with xxxx does not exist" when doing ExecMemoize()

Поиск
Список
Период
Сортировка
От Tender Wang
Тема Re: "type with xxxx does not exist" when doing ExecMemoize()
Дата
Msg-id CAHewXN=mzgHyFR2c0Z1hYAozYHWTdrEW90=oh0_Jn9kZVp6fYQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: "type with xxxx does not exist" when doing ExecMemoize()  (Andrei Lepikhov <a.lepikhov@postgrespro.ru>)
Ответы Re: "type with xxxx does not exist" when doing ExecMemoize()  (Tender Wang <tndrwang@gmail.com>)
Список pgsql-hackers
I read Memoize code and how other node use ResetExprContext() recently.

The comments about per_tuple_memory said that :

 * ecxt_per_tuple_memory is a short-term context for expression results.
 *  As the name suggests, it will typically be reset once per tuple,
 *  before we begin to evaluate expressions for that tuple.  Each
 *  ExprContext normally has its very own per-tuple memory context.

So ResetExprContext() should called once per tuple, but not in Hash and Equal function just as Richard said before.
In ExecResult() and ExecProjectSet(), they call ResetExprContext() once when enter these functions. 
So I think ExecMemoize() can do the same way. 

The attached patch includes below modifications:
1. 
When I read the code in nodeMemoize.c, I found a typos: outer should be inner, 
if I don't misunderstand the intend of Memoize.

2.
I found that almost executor node call CHECK_FOR_INTERRUPTS(), so I add it.
Is it right to add it for ExecMemoize()?

3.
I remove ResetExprContext() from Hash and Equal funciton. And I call it when enter
ExecMemoize() just like ExecPrejectSet() does.
ExecQualAndReset() is replaed with ExecQual().

4.
This patch doesn't include test case.  I use the Andrei's test case, but I don't repeat the aboved issue.
I may need to spend some more time to think about how to repeat this issue easily.

So, what do you think about the one proposed in v5? @Andrei Lepikhov  @Richard Guo @David Rowley .
I don't want to continue to do work based on v3 patch. As Andrei Lepikhov said, using mstate->tableContext for probeslot
is not good.  v5 looks more simple.
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Infinite loop in XLogPageRead() on standby
Следующее
От: Peter Smith
Дата:
Сообщение: DOCS: Avoid using abbreviation "aka"