Re: Support LIKE with nondeterministic collations
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Heikki Linnakangas <hlinnaka@iki.fi>,
Jacob Champion <jacob.champion@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>,
Daniel Verite <daniel@manitou-mail.org>,
Paul A Jungwirth <pj@illuminatedcomputing.com>
Date: 2024-11-12T07:45:23Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Support LIKE with nondeterministic collations
- 85b7efa1cdd6 18.0 landed
Attachments
- v7-0001-Support-LIKE-with-nondeterministic-collations.patch (text/plain) patch v7-0001
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.