Re: Index creation takes for ever - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Index creation takes for ever
Date
Msg-id 13925.1062080001@sss.pgh.pa.us
Whole thread Raw
In response to Index creation takes for ever  (ohp@pyrenet.fr)
Responses Re: Index creation takes for ever
Re: Index creation takes for ever
List pgsql-hackers
ohp@pyrenet.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       |  49435O       | 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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: suspicous looking code in copy.c
Next
From: ohp@pyrenet.fr
Date:
Subject: Re: Index creation takes for ever