X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 716B39DD695 for ; Thu, 1 Dec 2005 14:08:41 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09223-08-3 for ; Thu, 1 Dec 2005 14:08:36 -0400 (AST) X-Greylist: delayed 00:10:04.383687 by SQLgrey- Received: from rwcrmhc12.comcast.net (unknown [216.148.227.153]) by postgresql.org (Postfix) with ESMTP id 8F7029DD689 for ; Thu, 1 Dec 2005 14:08:36 -0400 (AST) Received: from dell8200 (pcp09613107pcs.rte20201.de.comcast.net[68.82.197.68]) by comcast.net (rwcrmhc13) with SMTP id <2005120117581601500ion9he>; Thu, 1 Dec 2005 17:58:25 +0000 From: "Rick Schumeyer" To: Subject: COPY into table too slow with index Date: Thu, 1 Dec 2005 12:58:12 -0500 Message-ID: <00b101c5f6a0$d0ffea40$0200a8c0@dell8200> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00B2_01C5F676.E829E240" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Importance: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.001 required=5 tests=[HTML_MESSAGE=0.001] X-Spam-Score: 0.001 X-Spam-Level: X-Archive-Number: 200512/32 X-Sequence-Number: 15853 This is a multi-part message in MIME format. ------=_NextPart_000_00B2_01C5F676.E829E240 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit I'm running postgresql 8.1.0 with postgis 1.0.4 on a FC3 system, 3Ghz, 1 GB memory. I am using COPY to fill a table that contains one postgis geometry column. With no geometry index, it takes about 45 seconds to COPY one file. If I add a geometry index, this time degrades. It keeps getting worse as more records are added to the table. It was up to over three minutes per file on my most recent test. The problem is that each file contains about 5 - 10 minutes of data. Eventually, I want to add the data to the table in "real time". So the COPY needs to take less time than actually generating the data. Here is the relevant section of my postgresql.conf. # - Memory - shared_buffers = 5000 # min 16 or max_connections*2, 8KB each #temp_buffers = 1000 # min 100, 8KB each #max_prepared_transactions = 5 # can be 0 or more # note: increasing max_prepared_transactions costs ~600 bytes of shared memory # per transaction slot, plus lock space (see max_locks_per_transaction). work_mem = 20000 # min 64, size in KB maintenance_work_mem = 20000 # min 1024, size in KB #max_stack_depth = 2048 # min 100, size in KB Any suggestions for improvement? ------=_NextPart_000_00B2_01C5F676.E829E240 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

I’m running postgresql 8.1.0 with postgis 1.0.4 = on a FC3 system, 3Ghz, 1 GB memory.

 

I am using COPY to fill a table that contains one = postgis geometry column.

 

With no geometry index, it takes about 45 seconds to = COPY one file.

 

If I add a geometry index, this time degrades.  = It keeps getting worse as more records are

added to the table.  It was up to over three = minutes per file on my most recent test.

 

The problem is that each file contains about 5 = – 10 minutes of data.  Eventually, I want to

add the data to the table in “real = time”.  So the COPY needs to take less time than

actually generating the data.

 

Here is the relevant section of my = postgresql.conf.

 

# - Memory = -

 

shared_buffers =3D = 5000           &nb= sp;   # min 16 or max_connections*2, 8KB each

#temp_buffers =3D = 1000           &nb= sp;    # min 100, 8KB each

#max_prepared_transactions =3D 5            # = can be 0 or more

# note: increasing = max_prepared_transactions costs ~600 bytes of shared memory

# per transaction = slot, plus lock space (see max_locks_per_transaction).

work_mem =3D = 20000           &n= bsp;  # min 64, size in KB

maintenance_work_mem =3D = 20000        # min 1024, size in KB

#max_stack_depth = =3D = 2048           &nb= sp; # min 100, size in KB

 

Any suggestions for improvement?

------=_NextPart_000_00B2_01C5F676.E829E240--