Re: Sustained inserts per sec ... ?

From: Christopher Petrilli <petrilli(at)gmail(dot)com>
To: PFC <lists(at)boutiquenumerique(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, jd(at)commandprompt(dot)com, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Sustained inserts per sec ... ?
Date: 2005-04-04 20:56:26
Message-ID: 59d991c4050404135650abda4f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Apr 4, 2005 4:53 PM, PFC <lists(at)boutiquenumerique(dot)com> 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(at)gmail(dot)com

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Simon Riggs 2005-04-04 20:58:23 Re: Sustained inserts per sec ... ?
Previous Message PFC 2005-04-04 20:53:21 Re: Sustained inserts per sec ... ?