Re: Refactor textToQualifiedNameList() - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Refactor textToQualifiedNameList()
Date
Msg-id 20181009032842.GE2137@paquier.xyz
Whole thread Raw
In response to Re: Refactor textToQualifiedNameList()  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Refactor textToQualifiedNameList()  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On Mon, Oct 08, 2018 at 03:22:55PM +0000, Pavel Stehule wrote:
> I tested this patch. This patch removes some duplicate rows, what is
> good -  on second hand, after this patch, the textToQualifiedNameList
> does one more copy of input string more. I looked where this function
> is used, and I don't think so it is a issue.
>
> This patch is trivial - all tests passed and I don't see any
> problem. I'll mark as ready for commit.
>
> The new status of this patch is: Ready for Committer

Are you sure that there is no performance impact?  Say implement a
simple SQL-callable function which does textToQualifiedNameList on the
same string N times, and then compare the time it takes to run HEAD and
the refactored implementation.  I may buy that an extra palloc call is
not something to worry about, but in my experience it can be a problem.

This patch also changes stringToQualifiedNameList from regproc.h to
varlena.h, which would break extensions calling it.  That's not nice
either.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: "Imai, Yoshikazu"
Date:
Subject: RE: Small performance tweak to run-time partition pruning
Next
From: Yang Xiao
Date:
Subject: Add overflow test in function numeric_exp.