Re: Considering fractional paths in Append node

From: Andrei Lepikhov <lepihov(at)gmail(dot)com>
To: Andy Fan <zhihuifan1213(at)163(dot)com>, Nikita Malakhov <hukutoc(at)gmail(dot)com>
Cc: 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-10-18 01:42:26
Message-ID: 187705cb-5ae8-4125-99f0-763591fe3ccd@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/18/24 07:54, Andy Fan wrote:
> Nikita Malakhov <hukutoc(at)gmail(dot)com> writes:
>> The effect is easily seen in one of standard PG tests:
> """
> I think that things might work out better if we redefined the startup
> cost as "estimated cost to retrieve the first tuple", rather than its
> current very-squishy definition as "cost to initialize the scan".
> """
> The above statement makes me confused. If we take the startup cost as
> cost to retrieve cost for the first tuple, we can do the below quick hack,
Promising way to go. Of course even in that case IndexScan usually gives
way to SeqScan (because of the additional heap fetch). And only
IndexOnlyScan may overcome it. Moreover, SeqScan first tuple cost is
contradictory issue - who knows, how much tuples it will filter before
the first tuple will be produced?

>
> Looks we still have some other stuff to do, but we have seen the desired
> plan has a closer cost to estimated best plan than before.
But our patch is about some different stuff: adding one more Append
strategy (and, as I realised recently, one promising MergeAppend too) we
give a chance upper fraction-friendly node to decide which plan is
better. Right now, AFAIK, only LIMIT node can profit from that (maybe
IncrementalSort if we include MergeAppend). But it may open a door to
improve other nodes too.

--
regards, Andrei Lepikhov

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Seino Yuki 2024-10-18 01:45:24 Re: Add “FOR UPDATE NOWAIT” lock details to the log.
Previous Message Jeff Davis 2024-10-18 01:41:14 Re: Statistics Import and Export