From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jose Vicente Nunez Z <josevnz@newbreak.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Inserting 26 million rows takes 8 hours, how to improve those times?
Date: Tue, 16 Sep 2003 11:40:51 -0400
Message-ID: <17679.1063726851@sss.pgh.pa.us> (raw)
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>
Jose Vicente Nunez Z <josevnz@newbreak.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, josevnz@newbreak.com
Subject: Re: Inserting 26 million rows takes 8 hours, how to improve those times?
In-Reply-To: <17679.1063726851@sss.pgh.pa.us>
References: <1063717273.5407.16.camel@linux0037> <17211.1063723476@sss.pgh.pa.us> <1063726066.5407.46.camel@linux0037> <17679.1063726851@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox