Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Performance testing of COPY (SELECT) TO

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Zoltan Boszormenyi <zboszor(at)dunaweb(dot)hu>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Performance testing of COPY (SELECT) TO
Date: 2006-08-28 15:54:16
Message-ID: 20060828155416.GK27526@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Zoltan Boszormenyi wrote:
> Andrew Dunstan írta:
> >Alvaro Herrera wrote:
> >>Böszörményi Zoltán wrote:
> >> 
> >>>what's the problem with COPY view TO, other than you don't like it? :-)
> >>
> >>The problem is that it required a ugly piece of code.  Not supporting it
> >>means we can keep the code nice.  The previous discussion led to this
> >>conclusion anyway so I don't know why we are debating it again.
> >
> >What is so ugly about it? I haven't looked at the code, but I am 
> >curious to know.

It used a "SELECT * FROM %s" string that was passed back to the parser.

> >I also don't recall the consensus being quite so clear cut. I guess 
> >there is a case for saying that if it's not allowed then you know that 
> >"COPY relname TO" is going to be fast. But, code aesthetics aside, the 
> >reasons for disallowing it seem a bit thin, to me.
> 
> I would say the timing difference between
> "COPY table TO" and "COPY (SELECT * FROM table) TO"
> was  noise, so it's not even faster.

Remember that we were talking about supporting views, not tables.  And
if a view uses a slow query then you are in immediate danger of having a
slow COPY.  This may not be a problem but it needs to be discussed and
an agreement must be reached before introducing such a change (and not
during feature freeze).

> And an updatable VIEW *may* allow COPY view FROM...

May I remind you that we've been in feature freeze for four weeks
already?  Now it's *not* the time to be drooling over cool features that
would be nice to have.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2006-08-28 15:59:18
Subject: Re: [PATCHES] Another VPATH patch for ecpg
Previous:From: Josh BerkusDate: 2006-08-28 15:46:08
Subject: Good news on CPU scaling for latest 8.2

pgsql-patches by date

Next:From: Alvaro HerreraDate: 2006-08-28 15:59:18
Subject: Re: [PATCHES] Another VPATH patch for ecpg
Previous:From: Zoltan BoszormenyiDate: 2006-08-28 15:33:23
Subject: Re: [HACKERS] Performance testing of COPY (SELECT) TO

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group