Re: Considering fractional paths in Append node

From: Nikita Malakhov <hukutoc(at)gmail(dot)com>
To: Andy Fan <zhihuifan1213(at)163(dot)com>
Cc: Andrei Lepikhov <lepihov(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Rowley <dgrowleyml(at)gmail(dot)com>
Subject: Re: Considering fractional paths in Append node
Date: 2024-11-01 18:18:47
Message-ID: CAN-LCVOC3V6rBMcBW9CVca3GXbU_H6e2PyZA8V05dsCMmF5-9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

I've checked set_subquery_pathlist(), and would rather say that it has
a different purpose and I'd better not compare these functions directly.

generate_orderedappend_paths() was introduced 6 years ago, and
commit that considers tuple_fraction authored by Tomas Vondra
was suggested by Tom Lane himself. Also, generate_orderedappend_paths()
is directly used in add_paths_to_append_rel(), so I don't see any
reasons not to use tuple_fraction for the same purpose as it is used
in generate_orderedappend_paths().

Maybe, let's wait what other reviewers would say?

Thank you for your opinion and interest!

I've corrected failing test and created a patch at Commitfest:
https://commitfest.postgresql.org/51/5361/

Please check.

On Tue, Oct 29, 2024 at 2:38 AM Andy Fan <zhihuifan1213(at)163(dot)com> wrote:

> Nikita Malakhov <hukutoc(at)gmail(dot)com> writes:
>
> > Hi,
> >
> > Andy, thank you, I've checked this thread out along with run-time
> > partition pruning.
> I'm not sure the relationshipe between this topic and run-time
> partitioin pruning..
>
> > I've spend some time hovering on the tuple_fraction field usage and
> would disagree
> > with you on this topic - it is already used on the RelOptInfo level
> later on, in
> > generate_orderedappend_paths()
>
> Looks you are right that root->tuple_fraction has been used on RelOptInfo
> level in the generate_orderedappend_paths(). But we also tried to
> use not in the RelOptInfo level such as set_subquery_pathlist. See..
>
> """
> /*
> * We can safely pass the outer tuple_fraction down to the subquery if the
> * outer level has no joining, aggregation, or sorting to do. Otherwise
> * we'd better tell the subquery to plan for full retrieval. (XXX This
> * could probably be made more intelligent ...)
> */
> """
>
> I'm not sure the "more intelligent" would be just use it directly.
>
> So I'm not saying we can't do this, just that the facts are:
> (a). root->tuple_fraction are not exactly same as RelOptInfo's
> tuple_fraction.
> (b). We have used root->tuple_fraction in RelOptInfo in some cases and
> also tried to not use it in some other case (and only use it under some
> situation similar like what I did before).
>
> Looks different committers have different opinion on this.
>
> --
> Best Regards
> Andy Fan
>
>
>
>

--
Regards,
Nikita Malakhov
Postgres Professional
The Russian Postgres Company
https://postgrespro.ru/

Attachment Content-Type Size
v2-0001-append-limit-v1.patch application/octet-stream 5.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2024-11-01 18:44:51 Re: Adding NetBSD and OpenBSD to Postgres CI
Previous Message Jeff Davis 2024-11-01 18:17:09 Re: Collation & ctype method table, and extension hooks