X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 018C4D1B502 for ; Tue, 16 Sep 2003 15:41:08 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 29344-02 for ; Tue, 16 Sep 2003 12:40:57 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 1C922D1B4E2 for ; Tue, 16 Sep 2003 12:40:57 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h8GFeppr017680; Tue, 16 Sep 2003 11:40:51 -0400 (EDT) To: Jose Vicente Nunez Z Cc: pgsql-admin@postgresql.org Subject: Re: Inserting 26 million rows takes 8 hours, how to improve those times? In-reply-to: <1063726066.5407.46.camel@linux0037> References: <1063717273.5407.16.camel@linux0037> <17211.1063723476@sss.pgh.pa.us> <1063726066.5407.46.camel@linux0037> Comments: In-reply-to Jose Vicente Nunez Z message dated "16 Sep 2003 11:27:46 -0400" Date: Tue, 16 Sep 2003 11:40:51 -0400 Message-ID: <17679.1063726851@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/273 X-Sequence-Number: 10361 Jose Vicente Nunez Z writes: > create table mytable > ( > a varchar(20) not null, > b varchar(20) not null, > c varchar(20) not null, > d char(6), > f int null, > g float not null, > h float not null > ) > recreating the original index takes forever: > create index myindex on mytable ( a, b, c ); > For some reason i don't see much I/O but a lot of CPU ussage: Hm. I'll bet that you are using a non-C locale, such that varchar comparisons depend on strcoll() instead of strcmp(). strcoll can be incredibly slow in some locales. Do you really need non-ASCII sort order? If not, I'll bet that re-initdb'ing in C locale will make a difference. regards, tom lane