Re: Cutting initdb's runtime (Perl question embedded)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andreas Karlsson <andreas@proxel.se>
Cc: pgsql-hackers@postgreSQL.org, Andres Freund <andres@anarazel.de>
Date: 2017-04-13T16:13:30Z
Lists: pgsql-hackers
Andreas Karlsson <andreas@proxel.se> writes: > Here is my proof of concept patch. It does basically the same thing as > Andres's patch except that it handles quoted values a bit better and > does not try to support anything other than the regproc type. > The patch speeds up initdb without fsync from 0.80 seconds to 0.55 > seconds, which is a nice speedup, while adding a negligible amount of > extra work on compilation. I've pushed this with some mostly-cosmetic adjustments: * created a single subroutine that understands how to split DATA lines, rather than having several copies of the regex * rearranged the code so that the data structure returned by Catalog::Catalogs() isn't scribbled on (which was already happening before your patch, but it seemed pretty ugly to me) * stripped out the bootstrap-time name lookup code from all of reg* not just regproc. There's certainly lots more that could be done in the genbki code, but I think all we can justify at this stage of the development cycle is to get the low-hanging fruit for testing speedups. regards, tom lane
Commits
-
Attempt to identify system timezone by reading /etc/localtime symlink.
- 995b4fe0b14f 11.4 landed
- 8de574aa8bf7 10.9 landed
- 77dc741a1727 9.5.18 landed
- 75b0f21e1b19 9.6.14 landed
- 37011bcb30a9 9.4.23 landed
- 23bd3cec6eb1 12.0 landed
-
Make sure to run one initdb TAP test with no TZ set
- 033b969edde6 10.0 landed
-
Use one transaction while reading postgres.bki, not one per line.
- 85a0781334a2 10.0 landed
-
Move bootstrap-time lookup of regproc OIDs into genbki.pl.
- 5e39f06cfe65 10.0 landed