Martijn van Oosterhout <kleptog@svana.org> writes:
> Every cast costs space and lookup time.
Actually, we could probably have a net time savings here if the text
cast cases were hard-wired into parse_coerce.c. The reason is that
about 10% of the default entries in pg_cast are "retail" implementations
of text-to-or-from-foo casts, and we could get rid of all those entries,
not to mention the associated pg_proc entries and underlying code.
That would certainly cut search time in pg_cast enough to pay for a
couple of hard-wired "typoid == TEXTOID" checks.
regards, tom lane