Re: COPY ENCODING revisited - Mailing list pgsql-hackers

From Itagaki Takahiro
Subject Re: COPY ENCODING revisited
Date
Msg-id AANLkTikPM3JrgzNiNppmwWDQ8OBWV9Mz8t_qOXjCCS6T@mail.gmail.com
Whole thread Raw
In response to Re: COPY ENCODING revisited  (Hitoshi Harada <umi.tanuki@gmail.com>)
List pgsql-hackers
On Fri, Feb 18, 2011 at 04:04, Hitoshi Harada <umi.tanuki@gmail.com> wrote:
> FWIW, I finally found the good example to cache miscellaneous data in
> file local, namely regexp.c. It allocates compiled regular expressions
> up to 32 by using malloc().

I'm not exactly sure the cache usage in mbutils.c because it doesn't have
routine for cache invalidation at all.  Conversion procs are rarely
replaced, but we might not ought to keep cached functions unlimitedly.

Regexp cache is OK because the algorithm cannot be modified at runtime.

> We need only 4 or so for encoding
> conversion cache, in which cache search doesn't seem like overhead.

We need to research what we should cache for conversion procs.
We will need 4 bytes per conversion pair if we cache only OIDs,
but sizeof(FmgrInfo) bytes if we use the same way as ToXXXConvProc cache.

-- 
Itagaki Takahiro


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Initial review of xslt with no limits patch
Next
From: Tom Lane
Date:
Subject: Re: Initial review of xslt with no limits patch