Re: Index creation takes for ever

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: Index creation takes for ever
Date: 2003-08-28 14:13:21
Message-ID: 13925.1062080001@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ohp 2003-08-28 14:19:06 Re: Index creation takes for ever
Previous Message Chris Bowlby 2003-08-28 14:05:17 Re: Hardware recommendations to scale to silly load

Browse pgsql-patches by date

  From Date Subject
Next Message ohp 2003-08-28 14:19:06 Re: Index creation takes for ever
Previous Message ohp 2003-08-28 12:41:58 Index creation takes for ever