X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id C56ED9DCB67; Wed, 15 Feb 2006 22:12:15 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83875-09; Wed, 15 Feb 2006 22:12:19 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from mailbox.samurai.com (mailbox.samurai.com [205.207.28.82]) by postgresql.org (Postfix) with ESMTP id 929CC9DC940; Wed, 15 Feb 2006 22:12:13 -0400 (AST) Received: from localhost (mailbox.samurai.com [205.207.28.82]) by mailbox.samurai.com (Postfix) with ESMTP id 88AAB2394F3; Wed, 15 Feb 2006 21:12:17 -0500 (EST) Received: from mailbox.samurai.com ([205.207.28.82]) by localhost (mailbox.samurai.com [205.207.28.82]) (amavisd-new, port 10024) with LMTP id 10882-01-7; Wed, 15 Feb 2006 21:12:16 -0500 (EST) Received: from [192.168.1.102] (d226-82-205.home.cgocable.net [24.226.82.205]) by mailbox.samurai.com (Postfix) with ESMTP id ECD952394B0; Wed, 15 Feb 2006 21:12:15 -0500 (EST) Subject: Re: qsort again (was Re: [PERFORM] Strange Create Index From: Neil Conway To: Tom Lane Cc: Gary Doades , pgsql-performance@postgresql.org, pgsql-hackers@postgresql.org In-Reply-To: <20781.1140046109@sss.pgh.pa.us> References: <43F38867.6010701@gpdnet.co.uk> <19510.1140036968@sss.pgh.pa.us> <19779.1140038874@sss.pgh.pa.us> <43F39E53.1020009@gpdnet.co.uk> <20781.1140046109@sss.pgh.pa.us> Content-Type: text/plain Date: Wed, 15 Feb 2006 21:12:52 -0500 Message-Id: <1140055972.31672.42.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mailbox.samurai.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.061 required=5 tests=[AWL=0.061] X-Spam-Score: 0.061 X-Spam-Level: X-Archive-Number: 200602/601 X-Sequence-Number: 79739 On Wed, 2006-02-15 at 18:28 -0500, Tom Lane wrote: > It seems clear that our qsort.c is doing a pretty awful job of picking > qsort pivots, while glibc is mostly managing not to make that mistake. > I haven't looked at the glibc code yet to see what they are doing > differently. glibc qsort is actually merge sort, so I'm not surprised it avoids this problem. -Neil