Re: pg_dump and --inserts / --column-inserts

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump and --inserts / --column-inserts
Date: 2010-07-16 16:40:08
Message-ID: 17640.1279298408@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Kellerer <spam_eater(at)gmx(dot)net> writes:
> the explanation of the --inserts option of pg_dumps states that

> "The --column-inserts option is safe against column order changes, though even slower."

> The way I read this is, that
> INSERT INTO table (column, ...) VALUES ...
> is slower than
> INSERT INTO table VALUES ...

> Is that really true?

I believe so, though I've not measured by how much.

> Why would explicitely stating the columns be slower than relying on implicit column ordering?

Well, first off, the volume of pg_dump'd data gets a lot larger due to
all the extra text. If your column values aren't textually wide, you
could easily be looking at 2x the space. That costs in I/O and network
transmission. In the second place, it does take time to parse those
column names and look them up in the catalog. Not much, but it'll add
up since it's done over again for every row.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-07-16 17:00:54 Re: Planner decisions
Previous Message Richard Huxton 2010-07-16 15:16:27 Re: Full Text Search dictionary issues