From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "Gordan Bobic" <gordan(at)freeuk(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org, "Stephen Livesey" <ste(at)exact3ex(dot)co(dot)uk> |
Subject: | Re: Re: Slowdown problem when writing 1.7million records |
Date: | 2001-02-27 19:34:50 |
Message-ID: | 7787.983302490@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
"Gordan Bobic" <gordan(at)freeuk(dot)com> writes:
> Are you using autocommit? Are you using fsync? You should probably
> periodically commit the data every few thousand inserts if you don't
> have autocommit enabled.
> [ various other speedup suggestions from other people ]
The thing that interests me here is the apparent slowdown as more data
is inserted. I don't see a good reason for that, and none of the
suggested remedies seem likely to eliminate it if we don't know what's
causing it.
INSERT per se should be an essentially constant-time operation, since
it's just slapping another record at the end of the table. Unless
you're using advanced features like triggers/rules/foreign keys,
it seems like any progressive slowdown would have to be blamed on
updates of indexes. But that's not normally a performance problem
except in pathological cases (zillions of equal keys for example ---
but Stephen's only index is a PRIMARY KEY, therefore UNIQUE, therefore
no equal keys). So I'm confused, and think this deserves more careful
examination as to *why* the slowdown, rather than just looking for
a quick&dirty workaround.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Norman J. Clarke | 2001-02-27 19:52:11 | Re: Does PostGresSQL have this feature? |
Previous Message | David Lynn | 2001-02-27 19:26:05 | Odd behavior with views and numeric columns |