Re: A performance issue with Memoize

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: A performance issue with Memoize
Дата
Msg-id 412552.1706203379@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: A performance issue with Memoize  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: A performance issue with Memoize
Список pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> I'd feel better about doing it your way if Tom could comment on if
> there was a reason he put the function calls that way around in
> 5ebaaa494.

Apologies for not having noticed this thread before.  I'm taking
a look at it now.  However, while sniffing around this I found
what seems like an oversight in paramassign.c's
assign_param_for_var(): it says it should compare all the same
fields as _equalVar except for varlevelsup, but it's failing to
compare varnullingrels.  Is that a bug?  It's conceivable that
it's not possible to get here with varnullingrels different and
all else the same, but I don't feel good about that proposition.

I tried adding

@@ -91,7 +91,10 @@ assign_param_for_var(PlannerInfo *root, Var *var)
                 pvar->vartype == var->vartype &&
                 pvar->vartypmod == var->vartypmod &&
                 pvar->varcollid == var->varcollid)
+            {
+                Assert(bms_equal(pvar->varnullingrels, var->varnullingrels));
                 return pitem->paramId;
+            }
         }
     }

This triggers no failures in the regression tests, but we know
how little that proves.

Anyway, that's just a side observation unrelated to the problem
at hand.  More later.

            regards, tom lane



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

Предыдущее
От: Sergey Prokhorenko
Дата:
Сообщение: Re: UUID v7
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Emit fewer vacuum records by reaping removable tuples during pruning