Re: Foreign key slows down copy/insert

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard van den Berg <richard(dot)vandenberg(at)trust-factory(dot)com>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, PFC <lists(at)boutiquenumerique(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Foreign key slows down copy/insert
Date: 2005-04-15 13:55:16
Message-ID: 2697.1113573316@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Richard van den Berg <richard(dot)vandenberg(at)trust-factory(dot)com> writes:
> Christopher Kings-Lynne wrote:
>> No explain analyze is done on the server...

> Yes, but the psql \timing is calculated on the client, right? That is
> the value that PFC was refering to.

You didn't show us any \timing. The 94.109 ms figure is all server-side.

As an example:

regression=# \timing
Timing is on.
regression=# explain analyze select * from tenk1;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------
Seq Scan on tenk1 (cost=0.00..458.00 rows=10000 width=244) (actual time=0.050..149.615 rows=10000 loops=1)
Total runtime: 188.518 ms
(2 rows)

Time: 210.885 ms
regression=#

Here, 188.5 is at the server, 210.8 is at the client. The difference is
not all network delay, either --- parse/plan overhead is in there too.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2005-04-15 14:06:06 Re: speed of querry?
Previous Message Dave Held 2005-04-15 13:40:13 Re: Intel SRCS16 SATA raid?