X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C177E535F3 for ; Mon, 4 Apr 2005 21:56:33 +0100 (BST) 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 62194-04 for ; Mon, 4 Apr 2005 20:56:25 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.202]) by svr1.postgresql.org (Postfix) with ESMTP id 37160533FA for ; Mon, 4 Apr 2005 21:56:24 +0100 (BST) Received: by rproxy.gmail.com with SMTP id a41so1315953rng for ; Mon, 04 Apr 2005 13:56:27 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=LsRcTrXX+zZaJxYy2tOVoVzwXFySxMIz9LMUWX0V7B62ocbtzyXJzNgk8337GfbdeeIakirSp/+TNxy1NcVGv/+HCDa9OdGDI5qHwbIUbP2u2SXmX8qjmiLRYG9qso2yFsu0bN7mIxc1wnJ+w7Tz5lsCzh7S9wlQ6kgP+a3YxlQ= Received: by 10.38.13.39 with SMTP id 39mr5638057rnm; Mon, 04 Apr 2005 13:56:26 -0700 (PDT) Received: by 10.38.207.41 with HTTP; Mon, 4 Apr 2005 13:56:26 -0700 (PDT) Message-ID: <59d991c4050404135650abda4f@mail.gmail.com> Date: Mon, 4 Apr 2005 16:56:26 -0400 From: Christopher Petrilli Reply-To: Christopher Petrilli To: PFC Subject: Re: Sustained inserts per sec ... ? Cc: Simon Riggs , jd@commandprompt.com, Tom Lane , "Marc G. Fournier" , pgsql-performance@postgresql.org In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <20050401140421.P18194@ganymede.hub.org> <1112644015.16721.790.camel@localhost.localdomain> <59d991c40504040648457808e9@mail.gmail.com> <59d991c4050401125956d6069d@mail.gmail.com> <1112388818.3487.34.camel@jd2.commandprompt.com> <59d991c4050401124638c4ab5d@mail.gmail.com> <28353.1112388128@sss.pgh.pa.us> <59d991c4050401113857086517@mail.gmail.com> <59d991c405040413184699cfe1@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.299 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200504/67 X-Sequence-Number: 11464 On Apr 4, 2005 4:53 PM, PFC wrote: > > This is done using COPY syntax, not INSERT syntax. So I suppose "yes" > > I do. The file that is being used for COPY is kept on a ramdisk. > > COPY or psql \copy ? > If you wanna be sure you commit after each COPY, launch a psql in a shell > and check if the inserted rows are visible (watching SELECT count(*) grow > will do) The script is Python, using pyexpect (a'la expect) and does this, exactly: psql = pexpect.spawn('/usr/local/pgsql/bin/psql -d bench2 ') [ ...] start = time.time() psql.expect_exact('bench2=#') psql.sendline("COPY events%03i FROM '/mnt/tmpfs/loadfile';" % (tablenum+1)) results.write('%s\n' % (time.time() - start)) results.flush() There's other code, but it's all related to building the loadfile. Note that I'm specifically including the time it takes to get the prompt back in the timing (but it does slip 1 loop, which isn't relevent). Chris -- | Christopher Petrilli | petrilli@gmail.com