Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n6njU-0000H4-0i for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Jan 2022 06:00:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n6njS-0005OW-Ob for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Jan 2022 06:00:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n6njS-0005ON-EH for pgsql-hackers@lists.postgresql.org; Mon, 10 Jan 2022 06:00:38 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n6njN-0001D8-GY for pgsql-hackers@postgresql.org; Mon, 10 Jan 2022 06:00:37 +0000 Received: by mail-pj1-x102c.google.com with SMTP id ie23-20020a17090b401700b001b38a5318easo5650740pjb.2 for ; Sun, 09 Jan 2022 22:00:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=CzuQXK0nIRiyQcBKmmxgjlpurGv3jT6sIeh8RyB/FgI=; b=YtIN4wkeaTQql+DANbZa9MFK0tbVXyGB2TXGp8fT47kLHdveFwXIQsi42YGT/MoYhI XaBD6q6yEKXYAgCSvrU9MRI1amGC2ou3m01jN7hpxzyjiT7uAtK8HyRpj/NTgY5pA10D Q7foQbXgDGWDFHEUnAOlmo+3pSYeiPBWyez7nnVwhB+L4PVdUd5SxbD9FGS4yYew/w0+ jqEz1zMSyGqwSGlqdqg5HwGla+O4NzZyNh3jYCWBYp7nJkEE3loRxLgw26ntnlCYfO+L qiiLVUaYxUJf5CHcaywIuDb6CR32twwU/qObbAq6p3K9/j5DIfDmoJlDzoIZJQTerpBU VYjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=CzuQXK0nIRiyQcBKmmxgjlpurGv3jT6sIeh8RyB/FgI=; b=y/ovA5QCJy3ATKfd7im8HY/d7DA1l9QTrDbd9KhppAKmkzb60UAg+1f6fGdlyCCu6H sf+e+zY/bqYwy+cE7tcqihi8y+8do91i1IqmWGinVoOwlRKFNIza5pGG372aJjyxlENX vVI2Z5OCqNMsvrVpWA3CA0l1nptlqvtdPQbG+L2ojq/HcY8YRldnHReYdxToJUhsMgFd j6lVULArgItSCiDy3+kyQnDu4812H5gumZHZRAo3UIvazuppLr3I7apxV7wL56OMtSRQ 9hmKpn6tVXTxl08sYT1XE/FIrveSytTk7zIwH9Jktacy+WKImDfLcHlajm5eTxB5ZFAI w9dw== X-Gm-Message-State: AOAM5318oY34upbo4vvUB2LFZ3DmHPjaMDtq15l2ZrWkAtNoOJT2nii6 5fR+Gp58GFKdM8cqklF+jaM= X-Google-Smtp-Source: ABdhPJwGsBzar4UNkauZ55jF8iuJbX27CZx90UZmu1pTAT5qCvBGYd7xD8NIjXYJhFFBk8v3TH71cQ== X-Received: by 2002:a17:902:a509:b0:143:7eb6:c953 with SMTP id s9-20020a170902a50900b001437eb6c953mr74008698plq.4.1641794432265; Sun, 09 Jan 2022 22:00:32 -0800 (PST) Received: from jrouhaud (1-171-174-202.dynamic-ip.hinet.net. [1.171.174.202]) by smtp.gmail.com with ESMTPSA id v11sm3189952pfi.191.2022.01.09.22.00.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jan 2022 22:00:31 -0800 (PST) Date: Mon, 10 Jan 2022 14:00:27 +0800 From: Julien Rouhaud To: Peter Eisentraut Cc: pgsql-hackers , Daniel Verite Subject: Re: ICU for global collation Message-ID: <20220110060027.egvaly4lskylo22f@jrouhaud> References: <374f8048-9d87-462c-a8aa-d02ffca6525f@manitou-mail.org> <525ef44f-52bf-505f-a491-07835d039424@enterprisedb.com> <20220110032508.4eyz6m6mpvt622la@jrouhaud> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220110032508.4eyz6m6mpvt622la@jrouhaud> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jan 10, 2022 at 11:25:08AM +0800, Julien Rouhaud wrote: > On Fri, Jan 07, 2022 at 03:25:28PM +0100, Peter Eisentraut wrote: > > > > I tested this a bit. I used the following setup: > > > > create table t1 (a text); > > insert into t1 select md5(generate_series(1, 10000000)::text); > > select count(*) from t1 where a > ''; > > > > And then I changed in varstr_cmp(): > > > > if (collid != DEFAULT_COLLATION_OID) > > mylocale = pg_newlocale_from_collation(collid); > > > > to just > > > > mylocale = pg_newlocale_from_collation(collid); > > > > I find that the \timing results are indistinguishable. (I used locale > > "en_US.UTF-8" and made sure that that code path is actually hit.) > > > > Does anyone have other insights? > > Looking at the git history, you added this comment in 414c5a2ea65. > > After a bit a digging in the lists, I found that you introduced it to fix a > reported 13% slowdown in varstr_cmp(): > https://www.postgresql.org/message-id/20110129075253.GA18784%40tornado.leadboat.com > https://www.postgresql.org/message-id/1296748408.6442.1.camel%40vanquo.pezone.net So I tried to run Noah's benchmark to see if I could reproduce the slowdown. Unfortunately the results I'm getting don't really make sense as removing the optimisation brings a 15% speedup, and with a few more runs I can see that I have about 25% noise, so there isn't much I can do to help.