Re: COPY FROM performance improvements

From: "Luke Lonergan" <llonergan(at)greenplum(dot)com>
To: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: agoldshuv(at)greenplum(dot)com, pgsql-patches(at)postgresql(dot)org
Subject: Re: COPY FROM performance improvements
Date: 2005-06-25 16:34:43
Message-ID: BEE2D5B4.7CD7%llonergan@greenplum.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Andrew,

> 1. Postgres does context diffs for patches, not unidiffs.

Yah - sorry. I used diff to get the "--ignore-space-change" feature. I've
attached a "cvs diff -c" with identical content.

> 2. This comment raises a flag in my mind:
>
> + * each attribute begins. If a specific attribute is not used for this
> + * COPY command (ommitted from the column list), a value of 0 will be
> assigned.+ * For example: for table foo(a,b,c,d,e) and COPY foo(a,b,e)
> + * attr_offsets may look something like this after this routine
> + * returns: [0,20,0,0,55]. That means that column "a" value starts
> + * at byte offset 0, "b" in 20 and "e" in 55, in attr_bytebuf.
>
> Would it not be better to mark missing attributes with something that can't
> be a valid offset, like -1?
>
> 3. This comment needs improving:
>
> +/*
> + * Copy FROM file to relation with faster processing.
> + */

Good comments! I'll look for Alon to respond on these.

> 4. We should indeed do this for CSV, especially since a lot of the relevant
> logic for detecting attribute starts is already there for CSV in
> CopyReadLine. I'm prepared to help you do that if necessary, since I'm
> guilty of perpetrating that code.

That would be awesome! We'll help you with testing and regressions when
you're ready.

- Luke

Attachment Content-Type Size
fast_copy_patch_V6_lal_ported_8.1-cvsdiff.patch application/octet-stream 50.5 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Alon Goldshuv 2005-06-25 17:17:21 Re: COPY FROM performance improvements
Previous Message Martin Pitt 2005-06-25 15:42:56 Re: Add PG version number to NLS files