Re: [HACKERS] Re: [GENERAL] Postgres INSERTs much slower than MySQL? - Mailing list pgsql-general

From Tom Lane
Subject Re: [HACKERS] Re: [GENERAL] Postgres INSERTs much slower than MySQL?
Date
Msg-id 20506.940604881@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Postgres INSERTs much slower than MySQL?  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Re: [GENERAL] Postgres INSERTs much slower than MySQL?  (Herouth Maoz <herouth@oumail.openu.ac.il>)
List pgsql-general
Bruce Momjian <maillist@candle.pha.pa.us> writes:
>> But what makes me unhappy right now is that with -F COPY FROM takes
>> JUST 3 min !!! (And 16 min without -F)
>> Isn't parsing/planning overhead toooo big ?!

> Yikes.  I always thought it would be nice to try and cache query plans
> by comparing parse trees, and if they match cached versions, replace any
> constants with new ones and use cached query plan.  Hard to do right,
> though.

But INSERT ... VALUES(...) has such a trivial plan that it's hardly
likely to be worth caching.  We probably ought to do some profiling to
see where the time is going, and see if we can't speed things up for
this simple case.

In the meantime, the conventional wisdom is still that you should use
COPY, if possible, for bulk data loading.  (If you need default values
inserted in some columns then this won't do...)

            regards, tom lane

pgsql-general by date:

Previous
From: "Moray McConnachie"
Date:
Subject: Re: [GENERAL] CREATE VIEW blah AS SELECT DISTINCT etc
Next
From: Jimmie Houchin
Date:
Subject: Re: [GENERAL] Re: What's WAL