Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

PostgreSQL performance -- VERY slow on INSERTing into tables without indexes in a small db

Avatar of GomerJones
GomerJones asked on
25 Comments1 Solution27350 ViewsLast Modified:
I have installed the latest PostgreSQL native Windows beta (8.0.0-beta4 using the Windows MSI installer) on a Windows XP Pro SP2 system.  I accepted all of the installation defaults, as far as I remember.  It is running successfully (I can store from my app, "pgAdmin III" shows the results, I can query using "psql")  and my application that stores data via ODBC (psqlodbc.dll, version is working.  But it is VERY slow to store.  A single INSERT takes an elapsed time of one second according to the query log, although the actiual query time is only 10 milliseconds (typically).  The tables being inserted into have no indexes.  The disk drive buzzes without stop as many INSERT's are done.   It does not matter whether they are Prepared or Direct INSERT's.  I have increased most of the configuration parameters in file "postgresql.conf" that relate to memory and buffer sizes to large numbers (see below), but nothing changes.  I have been sure to re-start the server each time so that the new conf parameters should take effect.  My app is explicitly beginning and committing transactions, one transaction over many INSERT's.  The size of "C:\Program Files\PostgreSQL\8.0.0-beta4\data\base" is 44 Mb.  My computer has 512 MB of RAM.

Why is it so slow?  Why all the disk activity?  How can I speed it up?  I am not asking for real performance tuning.  I just want to fix what is "broken".

customized Parameters:
shared_buffers = 8000
work_mem = 10240
bgwriter_percent = 0
bgwriter_maxpages = 0
fsync = false
wal_buffers = 1000
checkpoint_timeout = 3600
checkpoint_warning = 0

log_min_error_statement = debug
log_min_duration_statement = 0

Avatar of earth man2
earth man2Flag of United Kingdom of Great Britain and Northern Ireland image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 25 Comments.
See Answers