Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qhEhq-001m2k-Vg for pgsql-performance@arkaria.postgresql.org; Fri, 15 Sep 2023 19:42:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qhEhp-002pL7-8H for pgsql-performance@arkaria.postgresql.org; Fri, 15 Sep 2023 19:42:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qhEho-002pKl-TD for pgsql-performance@lists.postgresql.org; Fri, 15 Sep 2023 19:42:20 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qhEhi-004lvI-7d for pgsql-performance@lists.postgresql.org; Fri, 15 Sep 2023 19:42:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 38FJgAAf3666542; Fri, 15 Sep 2023 15:42:10 -0400 From: Tom Lane To: Achilleas Mantzios cc: pgsql-performance@lists.postgresql.org Subject: Re: pgsql 10.23 , different systems, same table , same plan, different Buffers: shared hit In-reply-to: References: <24a36ca8-b5c0-d39f-c5f6-47cf2ef51abd@cloud.gatewaynet.com> <3310210.1694791429@sss.pgh.pa.us> Comments: In-reply-to Achilleas Mantzios message dated "Fri, 15 Sep 2023 22:31:37 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3666540.1694806930.1@sss.pgh.pa.us> Date: Fri, 15 Sep 2023 15:42:10 -0400 Message-ID: <3666541.1694806930@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Achilleas Mantzios writes: > Thank you, I see that both systems use en_US.UTF-8 as lc_collate and > lc_ctype, Doesn't necessarily mean they interpret that the same way, though :-( > the below seems ok > FreeBSD : > postgres@[local]/dynacom=# select * from (values > ('a'),('Z'),('_'),('.'),('0')) as qry order by column1::text; > column1 > --------- > _ > . > 0 > a > Z > (5 rows) Sadly, this proves very little about Linux's behavior. glibc's idea of en_US involves some very complicated multi-pass sort rules. AFAICT from the FreeBSD sort(1) man page, FreeBSD defines en_US as "same as C except case-insensitive", whereas I'm pretty sure that underscores and other punctuation are nearly ignored in glibc's interpretation; they'll only be taken into account if the alphanumeric parts of the strings sort equal. regards, tom lane