From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Joe Conway <mail(at)joeconway(dot)com> |
Cc: | "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: polymorphic arguments and return type for PL/pgSQL |
Date: | 2003-06-30 18:36:29 |
Message-ID: | 16504.1056998189@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Joe Conway | 2003-06-30 18:40:47 | Re: polymorphic arguments and return type for PL/pgSQL |
Previous Message | Joe Conway | 2003-06-30 17:53:03 | Re: polymorphic arguments and return type for PL/pgSQL |