From: | Ben <bench(at)silentmedia(dot)com> |
---|---|
To: | PostgreSQL general <pgsql-general(at)postgresql(dot)org> |
Subject: | a question for the way-back machine |
Date: | 2006-12-13 21:10:44 |
Message-ID: | Pine.LNX.4.64.0612131259320.6762@localhost.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I'm using an ancient version of postgresql (7.3 - don't ask) and I'm
experiencing a problem where many inserts into an empty table slow down
over time, even if I analyze in the middle of the insertions.
pg_stat_user_tables shows lots and lots of full scans, which explains the
slowdown, but leads me to wonder why the full scans. Each insert is its
own transaction. This table has at least one unique index on it, and a
couple other multi-column indexes, so I was wondering if maybe that was
what was causing the full scans. But a an explain shows that a select for
that unique column will use the index, so now I'm wondering if maybe:
- 7.3 isn't smart enough to use an index on an insert? Seems unlikely.
- I have to start a new session to use new planner stats, even though each
insert is in it's own transaction?
Something I haven't verified for myself yet but have been told by others
is that if I start these inserts quickly after installing a new database
cluster (which probably translates as: before running "vacuum analyze" for
the first time), then these slowdowns do not occur. I can't figure out why
that might be.
Any other thoughts?
From | Date | Subject | |
---|---|---|---|
Next Message | Karsten Hilbert | 2006-12-13 21:16:38 | Re: Large IN query optimization |
Previous Message | Tony Caduto | 2006-12-13 21:02:53 | Re: grant all privileges on database |