Re: [HACKERS] Inefficiency in recent pgtz patch

Lists: pgsql-patches
From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "PostgreSQL-patches" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Inefficiency in recent pgtz patch
Date: 2005-06-04 13:05:52
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE6C75D0@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

>> Do you agree that using a hashtable for it in general is a good idea
>> assuming this sideeffect is removed, though?
>
>I have no problem with the hashtable, only with preloading it with
>everything. What I'd like to see is that the table inherited at fork()
>contains just the data for the default timezone. (At least in the
>normal case where that setting hasn't been changed since postmaster
>start.)

Here's a patch doing this. Changes score_timezone not to use pg_tzset(),
and thus not loading all the zones in the cache. The actual timezone
being picked will be set using set_global_timezone() which in turn calls
pg_tzset() and loads it in the cache.

//Magnus

Attachment Content-Type Size
tzcache.patch application/octet-stream 1.8 KB

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Magnus Hagander <mha(at)sollentuna(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Inefficiency in recent pgtz patch
Date: 2005-06-15 00:09:23
Message-ID: 200506150009.j5F09Ne21127@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Patch applied. Thanks.

---------------------------------------------------------------------------

Magnus Hagander wrote:
> >> Do you agree that using a hashtable for it in general is a good idea
> >> assuming this sideeffect is removed, though?
> >
> >I have no problem with the hashtable, only with preloading it with
> >everything. What I'd like to see is that the table inherited at fork()
> >contains just the data for the default timezone. (At least in the
> >normal case where that setting hasn't been changed since postmaster
> >start.)
>
> Here's a patch doing this. Changes score_timezone not to use pg_tzset(),
> and thus not loading all the zones in the cache. The actual timezone
> being picked will be set using set_global_timezone() which in turn calls
> pg_tzset() and loads it in the cache.
>
>
> //Magnus

Content-Description: tzcache.patch

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073