pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Guillaume Smet <guillaume.smet@gmail.com>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: Index creation time and distribution
Date: Thu, 22 May 2008 09:14:36 -0400
Message-ID: <29529.1211462076@sss.pgh.pa.us> (raw)
In-Reply-To: <1d4e0c10805220532v514c2bd5je4c6c20ceb485495@mail.gmail.com>
References: <1d4e0c10805220532v514c2bd5je4c6c20ceb485495@mail.gmail.com>

"Guillaume Smet" <guillaume.smet@gmail.com> writes:
> I experienced this morning a performance problem when we imported a
> dump in a 8.1 database.
> The table is 5 millions rows large and when the dump creates an index
> on a specific text column called clazz it takes 27 minutes while on
> the other columns, it only takes a couple of seconds:
> The only weird thing about this column is that 4.7 millions of rows
> have the exact same value.

Do you have maintenance_work_mem set large enough that the index
creation sort is done in-memory?  8.1 depends on the platform's qsort
and a lot of them are kinda pessimal for input like this.

8.2 (which uses our own qsort) seems to perform better in a quick
test.

			regards, tom lane



view thread (8+ messages)  latest in thread

Message-ID: <29529.1211462076@sss.pgh.pa.us>
Permalink:  ../29529.1211462076@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29529.1211462076@sss.pgh.pa.us

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, guillaume.smet@gmail.com
  Subject: Re: Index creation time and distribution
  In-Reply-To: <29529.1211462076@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