Re: Redundant Result node

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Guo <guofenglinux@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2024-08-23T03:19:17Z
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 →
  1. Avoid unnecessary post-sort projection

Richard Guo <guofenglinux@gmail.com> writes:
> ... we'll always make a separate ProjectionPath on top of the SortPath
> in create_ordered_paths.  It’s only when we create the plan node for
> the projection step in createplan.c that we realize a separate Result
> is unnecessary.  This is not efficient.

I'm not sure you're considering "efficiency" in the right light.
In my mind, any time we can postpone work from path-creation time
to plan-creation time, we're probably winning because we create
many more paths than plans.  Perhaps that's wrong in this case,
but it's not anywhere near as obvious as you suggest.

			regards, tom lane