Re: pgsql-server/src/backend/utils/sort tuplesort.c

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)svr1(dot)postgresql(dot)org>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server/src/backend/utils/sort tuplesort.c
Date: 2004-03-17 22:31:56
Message-ID: 200403172231.i2HMVun00293@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Tom Lane wrote:
> CVSROOT: /cvsroot
> Module name: pgsql-server
> Changes by: tgl(at)svr1(dot)postgresql(dot)org 04/03/17 18:24:58
>
> Modified files:
> src/backend/utils/sort: tuplesort.c
>
> Log message:
> During btree index build, sort equal-keyed tuples according to their
> TID (heap position). This doesn't do anything to the validity of the
> finished index, but by pretending to qsort() that there are no really
> equal keys in the sort, we can avoid performance problems with qsort
> implementations that have trouble with large numbers of equal keys.
> Patch from Manfred Koizar.

I think there is also the advantage that many equal keys will access the
heap in a more sequential, rather than random, order, which is the part
that really excited me.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2004-03-18 00:37:01 Re: pgsql-server/src/backend/utils/sort tuplesort.c
Previous Message Bruce Momjian 2004-03-17 22:30:10 pgsql-server/doc TODO