Re: Cutting initdb's runtime (Perl question embedded)

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgreSQL(dot)org, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Cutting initdb's runtime (Perl question embedded)
Date: 2017-04-12 19:15:53
Message-ID: 972d541d-7285-53ff-ea71-dcbfd886570a@proxel.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04/12/2017 05:00 PM, Andreas Karlsson wrote:
> Looked at this an option 1 seems simple enough if I am not missing
> something. I might hack something up later tonight. Either way I think
> this improvement can be done separately from the proposed replacement of
> the catalog header files. Trying to fix everything at once often leads
> to nothing being fixed at all.

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.

Two things which could be improved in this patch if people deem it
important:

- Refactor the code to be more generic, like Andres patch, so it is
easier to add lookups for other data types.

- Write something closer to a real .bki parser to actually understand
quoted values and _null_ when parsing the data. Right now this patch
only splits each row into its fields (while being aware of quotes) but
does not attempt to remove quotes. The PoC patch treats "foo" and foo as
different.

Andreas

Attachment Content-Type Size
bki-regproc-oids-v1.patch text/x-patch 5.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-04-12 19:18:38 Re: Adding support for Default partition in partitioning
Previous Message Andres Freund 2017-04-12 18:45:23 Re: Query fails when SRFs are part of FROM clause (Commit id: 69f4b9c85f)