Re: Inserting 26 million rows takes 8 hours, how to improve those times?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Inserting 26 million rows takes 8 hours, how to improve those times?
Дата
Msg-id 17679.1063726851@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Inserting 26 million rows takes 8 hours, how to  (Jose Vicente Nunez Z <josevnz@newbreak.com>)
Список pgsql-admin
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

В списке pgsql-admin по дате отправления:

Предыдущее
От: Jose Vicente Nunez Z
Дата:
Сообщение: Re: Inserting 26 million rows takes 8 hours, how to
Следующее
От: "scott.marlowe"
Дата:
Сообщение: Re: Inserting 26 million rows takes 8 hours, how to