Re: Make deparsing of column defaults faster

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Justin Pryzby <pryzby(at)telsasoft(dot)com>
Subject: Re: Make deparsing of column defaults faster
Date: 2018-07-30 11:51:23
Message-ID: CAMkU=1xbw01gfF4stYZ8twunG7oRVYJ0U++jG6U9iKvegZ2LFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 30, 2018 at 7:03 AM, Peter Eisentraut <
peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:

> On 07/07/2018 20:07, Jeff Janes wrote:
> > One case that your patch doesn't improve (neither does my posted one) is
> > check constraints. To fix that, pg_get_constraintdef_worker would also
> > need to grow a cache as well. I don't know how often people put check
> > constraints on most of the columns of a table. Some people like their
> > NOT NULL constraints to be named, not implicit.
> >
> > But from the bigger picture of making pg_upgrade faster, a major issue
> > is that while pg_dump -s gets faster for the column default case, the
> > restore of that dump is still slow (again, my posted patch also doesn't
> > fix that). In that case it is deparse_context_for called from
> > StoreAttrDefault which is slow.
>
> Any thoughts on how to proceed here? It seems there is more work to do
> to cover all the issues with dumping and restoring tables with many
> columns. Since the original report was in the context of pg_upgrade, we
> should surely address at least the pg_restore slowness.
>
>
I'll working on solving the problem using a hash table at the lowest level
(making column names unique), for a future commit fest. That should drop
it from N^3 to N^2, which since N can't go above 1600 should be good enough.

So we can set this to rejected, as that will be an entirely different
approach.

Your caching patch might be worthwhile on its own, though.

Cheers,

Jeff

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-07-30 12:07:17 Re: ssl_library parameter
Previous Message Peter Eisentraut 2018-07-30 11:03:50 Re: Make deparsing of column defaults faster