Re: Small improvements to substring()

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Small improvements to substring()
Date: 2026-02-15 22:50:30
Message-ID: 3D14DF4C-112E-4748-B38E-0A94CDC9B635@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Feb 15, 2026, at 05:45, Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
>
> Hi,
>
> As recently discussed on pgsql-bugs[1], substring() does unnecessary
> work that can easily be deleted. Here's a patch to try that.
>
> [1] https://www.postgresql.org/message-id/flat/19406-9867fddddd724fca%40postgresql.org
> <v1-0001-Improve-substring-implementation.patch>

Thanks for the patch. This is a great cleanup. The single-pass logic is more efficient, the special cases for empty strings have been removed, and the code is easier to follow now. After reviewing and playing with it, I don’t get any comment to raise.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-02-15 23:19:05 Re: pgstat include expansion
Previous Message Andres Freund 2026-02-15 22:39:21 Re: index prefetching