From: | Andrei Lepikhov <lepihov(at)gmail(dot)com> |
---|---|
To: | Alexander Korotkov <aekorotkov(at)gmail(dot)com> |
Cc: | Nikita Malakhov <hukutoc(at)gmail(dot)com>, Andy Fan <zhihuifan1213(at)163(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: | 2025-03-05 06:31:39 |
Message-ID: | ef097fda-264e-44de-8a6e-7a0fab1e4776@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 5/3/2025 03:27, Alexander Korotkov wrote:
> On Mon, Mar 3, 2025 at 1:04 PM Andrei Lepikhov <lepihov(at)gmail(dot)com> wrote:
>>> 2. As usage of root->tuple_fraction RelOptInfo it has been criticized,
>>> do you think we could limit this to some simple cases? For instance,
>>> check that RelOptInfo is the final result relation for given root.
>> I believe that using tuple_fraction is not an issue. Instead, it serves
>> as a flag that allows the upper-level optimisation to consider
>> additional options. The upper-level optimiser has more variants to
>> examine and will select the optimal path based on the knowledge
>> available at that level. Therefore, we're not introducing a mistake
>> here; we're simply adding extra work in the narrow case. However, having
>> only the bottom-up planning process, I don't see how we could avoid this
>> additional workload.
>
> Yes, but if we can assume root->tuple_fraction applies to result of
> Append, it's strange we apply the same tuple fraction to all the child
> rels. Latter rels should less likely be used at all and perhaps
> should have less tuple_fraction.
Of course, it may happen. But I'm not sure it is a common rule.
Using LIMIT, we usually select data according to specific clauses.
Imagine, we need TOP-100 ranked goods. Appending partitions of goods, we
will use the index on the 'rating' column. But who knows how top-rated
goods are spread across partitions? Maybe a single partition contains
all of them? So, we need to select 100 top-rated goods from each partition.
Hence, applying the same limit to each partition seems reasonable, right?
--
regards, Andrei Lepikhov
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Kapila | 2025-03-05 06:41:54 | Re: Separate GUC for replication origins |
Previous Message | Masahiko Sawada | 2025-03-05 06:25:57 | Re: Add contrib/pg_logicalsnapinspect |