Re: polymorphic arguments and return type for PL/pgSQL
| От | Tom Lane |
|---|---|
| Тема | Re: polymorphic arguments and return type for PL/pgSQL |
| Дата | |
| Msg-id | 16504.1056998189@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: polymorphic arguments and return type for PL/pgSQL (Joe Conway <mail@joeconway.com>) |
| Ответы |
Re: polymorphic arguments and return type for PL/pgSQL
Re: polymorphic arguments and return type for PL/pgSQL |
| Список | pgsql-patches |
> Do you think it would be better to do
> 1) a hash lookup by function oid to a linked list of different compiled
> versions (for each set of argument/return types)
> -or-
> 2) create hash key using a new structure that includes function oid,
> return type, and argument types, and use that for direct lookup.
The latter. By the time you pay the price of a hash lookup, a slightly
longer key is nearly free. (Maybe entirely free, since it might produce
better-distributed hash values.)
dynahash only supports fixed-length keys, so don't forget to zero out
unused positions in the argument type vector.
BTW, I can't see any need to include the return type in the hash key ---
wouldn't it be predetermined given the argument types?
regards, tom lane
В списке pgsql-patches по дате отправления: