X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0CF0FD8E5D for ; Fri, 23 Sep 2005 08:05:07 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 31475-04 for ; Fri, 23 Sep 2005 11:04:59 +0000 (GMT) Received: from vms040pub.verizon.net (vms040pub.verizon.net [206.46.252.40]) by svr1.postgresql.org (Postfix) with ESMTP id 38223D8D6E for ; Fri, 23 Sep 2005 08:04:59 -0300 (ADT) Received: from osgiliath.mathom.us ([70.108.61.78]) by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IN900DY1O4DGN10@vms040.mailsrvcs.net> for pgsql-performance@postgresql.org; Fri, 23 Sep 2005 06:05:02 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by osgiliath.mathom.us (Postfix) with ESMTP id 1A81F637C33 for ; Fri, 23 Sep 2005 07:05:01 -0400 (EDT) Received: from osgiliath.mathom.us ([127.0.0.1]) by localhost (osgiliath [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11884-02-5 for ; Fri, 23 Sep 2005 07:05:00 -0400 (EDT) Received: by osgiliath.mathom.us (Postfix, from userid 1000) id D28D662CA50; Fri, 23 Sep 2005 07:05:00 -0400 (EDT) Date: Fri, 23 Sep 2005 07:05:00 -0400 From: Michael Stone Subject: Re: How to determine cause of performance problem? In-reply-to: <1127470875.3524.17.camel@Panoramix> To: pgsql-performance@postgresql.org Mail-Followup-To: pgsql-performance@postgresql.org Message-id: <20050923110500.GX14918@mathom.us> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-disposition: inline X-Pgp-Fingerprint: 53 FF 38 00 E7 DD 0A 9C 84 52 84 C5 EE DF 7C 88 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at mathom.us References: <1127458167.2475.105.camel@Panoramix> <20050923095517.GW14918@mathom.us> <1127470875.3524.17.camel@Panoramix> User-Agent: Mutt/1.5.10i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 required=5 tests=[AWL=0.005] X-Spam-Level: X-Archive-Number: 200509/282 X-Sequence-Number: 14590 On Fri, Sep 23, 2005 at 12:21:15PM +0200, Joost Kraaijeveld wrote: >On Fri, 2005-09-23 at 05:55 -0400, Michael Stone wrote: >> It's not clear what your object id generator does. If it's just a >> sequence, it's not clear that you need this program at all--just use a >> SELECT INTO and make the object id a SERIAL. >It generates a GUID (and no, I do not want to turn this in a discussion >about GUIDs). As in the Java code comment: it is not the generation of >the GUID that is the problem (that is, I can generate millions of them >per second.) I didn't say it was, did I? If you use a SELECT INTO instead of SELECTing each record and then reINSERTing it you avoid a round trip latency for each row. There's a reason I said "if it's just a sequence". >> If you do need to control the object id or do some other processing >> before putting the data into the new table, rewrite to use a COPY >> instead of an INSERT. >It is actually the shortest piece of code that gives me a poor >performance. The conversion problem is much, much larger and much much >more complicated. Ok, that's great, but you didn't respond to the suggestion of using COPY INTO instead of INSERT. >But I have no clue where to begin with determining the bottleneck (it >even may be a normal performance for all I know: I have no experience >with converting such (large) database). > >Any suggestions? Respond to the first suggestion? Mike Stone