Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlGCm-0000q0-Uo for pgsql-performance@arkaria.postgresql.org; Fri, 25 Aug 2017 15:07:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dlGCm-0005kf-Ax for pgsql-performance@arkaria.postgresql.org; Fri, 25 Aug 2017 15:07:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dlGCl-0005kV-QS for pgsql-performance@postgresql.org; Fri, 25 Aug 2017 15:07:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dlGCi-0006Uj-5G for pgsql-performance@postgresql.org; Fri, 25 Aug 2017 15:07:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v7PF7Lq9000794; Fri, 25 Aug 2017 11:07:21 -0400 From: Tom Lane To: =?utf-8?Q?Felix_Geisend=C3=B6rfer?= cc: pgsql-performance@postgresql.org Subject: Re: 10x faster sort performance on Skylake CPU vs Ivy Bridge In-reply-to: <79C36278-87E4-4F9C-9C34-FA4ECB2B4B49@felixge.de> References: <79C36278-87E4-4F9C-9C34-FA4ECB2B4B49@felixge.de> Comments: In-reply-to =?utf-8?Q?Felix_Geisend=C3=B6rfer?= message dated "Fri, 25 Aug 2017 16:12:26 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <792.1503673641.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 25 Aug 2017 11:07:21 -0400 Message-ID: <793.1503673641@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org =3D?utf-8?Q?Felix_Geisend=3DC3=3DB6rfer?=3D writes: > I recently came across a performance difference between two machines that= surprised me: > ... > As you can see, Machine A spends 5889ms on the Sort Node vs 609ms on Mach= ine B when looking at the "Exclusive" time with explain.depesz.com [3][4]. = I.e. Machine B is ~10x faster at sorting than Machine B (for this particula= r query). I doubt this is a hardware issue, it's more likely that you're comparing apples and oranges. The first theory that springs to mind is that the sort keys are strings and you're using C locale on the faster machine but some non-C locale on the slower. strcoll() is pretty darn expensive compared to strcmp() :-( regards, tom lane --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance