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 1qhFYf-001pq5-E1 for pgsql-performance@arkaria.postgresql.org; Fri, 15 Sep 2023 20:36:57 +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 1qhFYc-003774-Qv for pgsql-performance@arkaria.postgresql.org; Fri, 15 Sep 2023 20:36:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qhFYc-00376p-Ft for pgsql-performance@lists.postgresql.org; Fri, 15 Sep 2023 20:36:54 +0000 Received: from cloud.gatewaynet.com ([185.90.37.94]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qhFYZ-005JVV-LG for pgsql-performance@lists.postgresql.org; Fri, 15 Sep 2023 20:36:53 +0000 Message-ID: <1309ac58-2a66-973a-02c7-9ec8182d05bf@cloud.gatewaynet.com> Date: Fri, 15 Sep 2023 23:36:48 +0300 MIME-Version: 1.0 Subject: Re: pgsql 10.23 , different systems, same table , same plan, different Buffers: shared hit Content-Language: en-US To: Tom Lane Cc: pgsql-performance@lists.postgresql.org References: <24a36ca8-b5c0-d39f-c5f6-47cf2ef51abd@cloud.gatewaynet.com> <3310210.1694791429@sss.pgh.pa.us> <3666541.1694806930@sss.pgh.pa.us> From: Achilleas Mantzios In-Reply-To: <3666541.1694806930@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Στις 15/9/23 22:42, ο/η Tom Lane έγραψε: > 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 Thank you so much. Makes perfect sense. This begs the question asked also in the -sql list : how do I index on regex'es, or at least have a barely scalable solution? Here I try to match a given string against a stored regex, whereas in pg_trgm's case the user tries to match a stored text against a given regex. > alphanumeric parts of the strings sort equal. > > regards, tom lane -- Achilleas Mantzios IT DEV - HEAD IT DEPT Dynacom Tankers Mgmt