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.96) (envelope-from ) id 1vaTpg-0099y5-0o for pgsql-general@arkaria.postgresql.org; Tue, 30 Dec 2025 07:07:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vaTpe-003Eq2-27 for pgsql-general@arkaria.postgresql.org; Tue, 30 Dec 2025 07:07:51 +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.96) (envelope-from ) id 1vaTpe-003Ept-13 for pgsql-general@lists.postgresql.org; Tue, 30 Dec 2025 07:07:51 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vaTpc-003WnJ-2s for pgsql-general@lists.postgresql.org; Tue, 30 Dec 2025 07:07:50 +0000 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-b728a43e410so1837118166b.1 for ; Mon, 29 Dec 2025 23:07:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767078468; x=1767683268; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0SD2D7O8kyb1dn4WFDEyICrkTVwM3puC4ym3St8p//s=; b=TXKv4o/5CRCHsQ7QgjuJWw8xzQLiFaW2Wc7XMj0MfIod6tuLFd5XhjK3tSvqrVXpD+ bcNbvi2/M/lXr/+254/Hm+sNYMIlIF+BY1tc5xaHeQXx+s+R3bRxSxBeYwjJyVjx84EO NTgDS2MSeRvgPQT6levJQjO3SFGaGPdep8HE/h74Zp7skMyzlUdIibgU2c4tS/3fINHj JG+tpIC8Wny7cPay0WQpPWqIT8NBJ+bC/hRqjzlH78xXuBBus9+4F8eJ5MvR8lYAj90u EL+XlOvUHGb/yAa60h9obCSE+B0HOI0HN7WNJFe2xvViX1uFrNlXsqtWiWZsDXP5t1rS lzYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767078468; x=1767683268; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0SD2D7O8kyb1dn4WFDEyICrkTVwM3puC4ym3St8p//s=; b=cQdKj7YCegpwdFcLwClJ3dxyty2Xlqvy4eifWyIJ1ua/Qt8l0GFiAT6l4aEY11YkfN hXolPoccfm2QW7qdVr69ZVCeShjZXV+v835IcM/0gZT6fFAHB5SPJ6FvSTTCreW1Zvrw neywN7QBQNwAgXCU7ezam7tIitO22udxT4yPsg68e7//AVese7AU/gZie8FPHpn1AAhX b7a5MHaQSvjeupNPI2DIlX1ATw89lDT5hYzrJmKvcRP7bOjVKLcDznG+yV96kfDfhkzv 4qSV8HNq+w3zcBpF2ebj9Y0QcnmNOAdbHvEnDsRBcOfV+VlruYjDAZitSTSS0proY971 ZpTA== X-Gm-Message-State: AOJu0Yy1juldRxDK3P3/RL0g6znJdzrR9T7d62UJc6DWE2KCvlPrzsAL sP7dqE7V3Ri8ZGlRsA2ctvkdBWWRHgzHWC2D9eXpsI+wa1ZxD8hIzDRaoNqth9TYOaqiwrTBZqv 5LgygkxCIGKOSakfibsXP0jfV/AdnFZ93QPit X-Gm-Gg: AY/fxX5XDcvZJMcexAus8X8L0pXXP5Gjq0M3UtNkFJM4upR5yzheHl7k54g8HtF3NVs 45tAe0erpvKNiTAzkPr5ppR7kxRgnCQoU5hxCPSVsSuU+xwcVG4q3Grxv2nBIX5IV4iyCyN+Szq nHI4UocnIKjuimL8SpG6T6dLw/H5kJ26C+jwnfxViZkxDzyZSkkXQu9z4Oqp6Jn9c7sNxm+zkRm RLP1oMDrvJFbOMSwCx8I8UaJY3+CRmE2ibMtqkmz4Vv/RACr8H05Ujwibh4+Voxf5luMtc= X-Google-Smtp-Source: AGHT+IGsSmNYfR/TO/YPNNzWxmfkM3ihtL5DMasH31Z6JHRO+elY4ytAEhMWS4KifvmqIy8UqqlWK4szLNz9vahRmMU= X-Received: by 2002:a17:907:6093:b0:b83:246c:c857 with SMTP id a640c23a62f3a-b83246ccc94mr1485147466b.17.1767078467742; Mon, 29 Dec 2025 23:07:47 -0800 (PST) MIME-Version: 1.0 References: <3287814.1767077500@sss.pgh.pa.us> In-Reply-To: <3287814.1767077500@sss.pgh.pa.us> From: Rahman Duran Date: Tue, 30 Dec 2025 10:07:22 +0300 X-Gm-Features: AQt7F2p3wWjqy6qUA85OTVO9WbP0fLLfG6x_RxH1zpx9Cmh9vKiEmhCbDGCo4G8 Message-ID: Subject: Re: PostgreSQL 18.1 non deterministic collation "LIKE %abc%" performance To: Tom Lane Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000005c2f61064726049a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005c2f61064726049a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Tom Lane , 30 Ara 2025 Sal, 09:51 tarihinde =C5=9Funu ya= zd=C4=B1: >The fundamental problem here is not wanting to make assumptions about >which character strings a non-deterministic collation will consider >equal to which other character strings. If you have concrete ideas >about how to improve that, let's hear them. Thanks for the explanations. I am just a user, not a DB developer :) So no ideas I am afraid. I was just surprised that running the lower() function on every column of every row is way faster than using nondeterministic collation. I will test GIN index with trigram to see if it helps. If not I will leave the code as is with lower() functions. Regards, Rahman Duran --0000000000005c2f61064726049a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Tom Lane <tgl@sss.pgh.pa.us>, 30 Ara 2025 Sal, 09:51 tarihinde = =C5=9Funu yazd=C4=B1:
>The fundamental problem here is not wan= ting to make assumptions about
>which character strings a non-determi= nistic collation will consider
>equal to which other character string= s.=C2=A0 If you have concrete ideas
>about how to improve that, let&#= 39;s hear them.

Thanks for the explanations. I am = just a user, not a DB developer :) So no ideas I am afraid. I was just surp= rised=C2=A0that running the lower() function on every column of every row i= s way faster than using nondeterministic collation. I will test GIN index w= ith trigram to see if it helps. If not I will leave the code as is with low= er() functions.

Regards,
Rahman Duran

--0000000000005c2f61064726049a--