Re: psql: Greatly speed up "\d tablename" when not using regexes - Mailing list pgsql-hackers

From Kirill Reshke
Subject Re: psql: Greatly speed up "\d tablename" when not using regexes
Date
Msg-id CALdSSPjcUmVLidTTb+CANyd2TEq0tkOCe=r+xYbuhpuOePKHag@mail.gmail.com
Whole thread Raw
In response to Re: psql: Greatly speed up "\d tablename" when not using regexes  (Jelte Fennema-Nio <postgres@jeltef.nl>)
List pgsql-hackers

On Wed, 10 Apr 2024, 23:37 Jelte Fennema-Nio, <postgres@jeltef.nl> wrote:
On Wed, 10 Apr 2024 at 20:21, Kirill Reshke <reshkekirill@gmail.com> wrote:
> Do we need to force Collaction here like in other branches?
> if (PQserverVersion(conn) >= 120000)
>    appendPQExpBufferStr(buf, " COLLATE pg_catalog.default");

According to the commit and codecomment that introduced the COLLATE,
it was specifically added for correct regex matching (e.g. \w). So I
don't think it's necessary, and I'm pretty sure adding it will cause
the index scan not to be used anymore.

Ok, thanks for the clarification. If all of this is actually true, and patch is really does speedup, maybe we need to state this in the comments?

pgsql-hackers by date:

Previous
From: Jelte Fennema-Nio
Date:
Subject: Re: psql: Greatly speed up "\d tablename" when not using regexes
Next
From: Pavel Stehule
Date:
Subject: Re: broken JIT support on Fedora 40