Re: Support LIKE with nondeterministic collations

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Daniel Verite <daniel(at)manitou-mail(dot)org>, Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
Subject: Re: Support LIKE with nondeterministic collations
Date: 2024-11-12 07:45:23
Message-ID: 62156cde-b2c5-4375-b47a-9730aa8f7b5e@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11.11.24 14:25, Heikki Linnakangas wrote:
> Sadly the algorithm is O(n^2) with non-deterministic collations.Is there
> any way this could be optimized? We make no claims on how expensive any
> functions or operators are, so I suppose a slow implementation is
> nevertheless better than throwing an error.

Yeah, maybe someone comes up with new ideas in the future.

> Let's at least add some CHECK_FOR_INTERRUPTS(). For example, this takes
> a very long time and is uninterruptible:
>
>  SELECT repeat('x', 100000) LIKE '%xxxy%' COLLATE ignore_accents;

Good idea. Here is a new patch version with an interrupt check.

Attachment Content-Type Size
v7-0001-Support-LIKE-with-nondeterministic-collations.patch text/plain 25.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2024-11-12 08:04:28 RE: Fix for pageinspect bug in PG 17
Previous Message Michael Paquier 2024-11-12 07:39:48 Re: Fix for pageinspect bug in PG 17