Re: Index creation takes for ever

From: ohp(at)pyrenet(dot)fr
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Index creation takes for ever
Date: 2003-08-28 14:19:06
Message-ID: Pine.UW2.4.53.0308281615070.21144@server.pyrenet.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hi Tom,
This is on unixware 7 (both 7.3.4 and 7.4b)

I'm on the FR language (I'll re-initdb whith lang=C to see what happens)
But I never had a problem before.
Waiting for a reply, I drop the table after copying it, and arranged sql
script to create the indexes BEFORE the COPY

The overall process took only 5 Min.
On Thu, 28 Aug 2003, Tom Lane wrote:

> Date: Thu, 28 Aug 2003 10:13:21 -0400
> From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> To: ohp(at)pyrenet(dot)fr
> Cc: pgsql-hackers list <pgsql-hackers(at)postgresql(dot)org>
> Subject: Re: [HACKERS] Index creation takes for ever
>
> ohp(at)pyrenet(dot)fr writes:
> > I've then pg_dump'ed the database and recreate an other both on 7.3.4 and
> > 7.4b
>
> > Both are still running after more than 30 minutes of CPU (100% cpu taken)
> > creating the levt_lu_ligne_evt_key.
>
> That's hard to believe. I get
>
> regression=# SELECT levt_lu,count(*) from ligne_evt group by levt_lu;
> levt_lu | count
> ---------+--------
> N | 49435
> O | 181242
> (2 rows)
>
> Time: 6927.28 ms
> regression=# create index levt_lu_ligne_evt_key on ligne_evt (levt_lu);
> CREATE INDEX
> Time: 14946.74 ms
>
> on a not-very-fast machine ... and it seems to be mostly I/O bound.
>
> What platform are you on? I could believe that the local qsort() is
> incredibly inefficient with many equal keys. Another possibility is
> that you're using a non-C locale and strcoll() is horribly slow.
>
> regards, tom lane
>

--
Olivier PRENANT Tel: +33-5-61-50-97-00 (Work)
6, Chemin d'Harraud Turrou +33-5-61-50-97-01 (Fax)
31190 AUTERIVE +33-6-07-63-80-64 (GSM)
FRANCE Email: ohp(at)pyrenet(dot)fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shridhar Daithankar 2003-08-28 14:23:13 Re: Hardware recommendations to scale to silly load
Previous Message Tom Lane 2003-08-28 14:13:21 Re: Index creation takes for ever

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-08-28 14:38:26 Re: Index creation takes for ever
Previous Message Tom Lane 2003-08-28 14:13:21 Re: Index creation takes for ever