Re: Sustained inserts per sec ... ? - Mailing list pgsql-performance

From Christopher Petrilli
Subject Re: Sustained inserts per sec ... ?
Date
Msg-id 59d991c4050404135650abda4f@mail.gmail.com
Whole thread Raw
In response to Re: Sustained inserts per sec ... ?  (PFC <lists@boutiquenumerique.com>)
List pgsql-performance
On Apr 4, 2005 4:53 PM, PFC <lists@boutiquenumerique.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@gmail.com

pgsql-performance by date:

Previous
From: PFC
Date:
Subject: Re: Sustained inserts per sec ... ?
Next
From: Simon Riggs
Date:
Subject: Re: Sustained inserts per sec ... ?