Re: [HACKERS] Time to run initdb is mostly figure-out-the-timezone work

2009-12-19 Thread Alex Hunsaker
On Fri, Dec 18, 2009 at 10:57, Tom Lane wrote: > Obviously there's something there for the kernel guys to fix, but > even with a non-borked kernel it's an expensive thing to do. Any thoughts on back patching this? While its not a bug per-say, it seems reasonably low-risk. I for one would love a

Re: [HACKERS] Time to run initdb is mostly figure-out-the-timezone work

2009-12-18 Thread Tom Lane
Alvaro Herrera writes: > I notice that most of the difference is system time ... I imagine we do > a lot of syscalls to guess the timezone. Yeah, it seems to be mostly the cost of searching the timezone directory tree and reading all those small files. I was led to notice this because Red Hat's

Re: [HACKERS] Time to run initdb is mostly figure-out-the-timezone work

2009-12-18 Thread Tom Lane
Joshua Tolley writes: > On Fri, Dec 18, 2009 at 06:20:39PM +0100, Guillaume Lelarge wrote: >> Le 18/12/2009 18:07, Tom Lane a écrit : >>> On current Fedora 11, there is a huge difference in initdb time if you >>> have TZ set versus if you don't: I get about 18 seconds versus less than >>> four. >

Re: [HACKERS] Time to run initdb is mostly figure-out-the-timezone work

2009-12-18 Thread Alvaro Herrera
Tom Lane wrote: > On current Fedora 11, there is a huge difference in initdb time if you > have TZ set versus if you don't: I get about 18 seconds versus less than > four. Wow, I can reproduce this (11-12 secs when no TZ versus 5 when TZ is defined). I'd never noticed because I normally have TZ s

Re: [HACKERS] Time to run initdb is mostly figure-out-the-timezone work

2009-12-18 Thread Joshua Tolley
On Fri, Dec 18, 2009 at 06:20:39PM +0100, Guillaume Lelarge wrote: > Le 18/12/2009 18:07, Tom Lane a écrit : > > On current Fedora 11, there is a huge difference in initdb time if you > > have TZ set versus if you don't: I get about 18 seconds versus less than > > four. > I have the exact same issu

Re: [HACKERS] Time to run initdb is mostly figure-out-the-timezone work

2009-12-18 Thread Guillaume Lelarge
Le 18/12/2009 18:07, Tom Lane a écrit : > On current Fedora 11, there is a huge difference in initdb time if you > have TZ set versus if you don't: I get about 18 seconds versus less than > four. > > $ time initdb > ... blah blah blah ... > > real0m17.953s > user0m6.490s > sys 0m10.93

[HACKERS] Time to run initdb is mostly figure-out-the-timezone work

2009-12-18 Thread Tom Lane
On current Fedora 11, there is a huge difference in initdb time if you have TZ set versus if you don't: I get about 18 seconds versus less than four. $ time initdb ... blah blah blah ... real0m17.953s user0m6.490s sys 0m10.935s $ rm -rf $PGDATA $ export TZ=GMT $ time initdb ... blah b