Re: Question about maxTapes & selectnewtape & dumptuples

From: Andy Fan <zhihuifan1213(at)163(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Question about maxTapes & selectnewtape & dumptuples
Date: 2024-06-30 11:17:09
Message-ID: 87msn2wuh6.fsf@163.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <hlinnaka(at)iki(dot)fi> writes:

> On 30/06/2024 12:48, Andy Fan wrote:

>> for example, at the first use of outputTapes[x], it stores (1, 3, 5,
>> 7),
>> and later (2, 4, 6, 8) are put into it. so the overall of (1, 3, 5, 7,
>> 2, 4, 6, 8) are not sorted? Where did I go wrong?
>
> There's a distinction between "runs" and "tapes". Each "run" is sorted,
> but there can be multiple runs on a tape. In that case, multiple merge
> passes are needed. Note the call to markrunend() between the runs. In
> your example, the tape would look like (1, 3, 5, 7, <end marker>, 2, 4,
> 6, 8).

I see, Thank you for your answer!

--
Best Regards
Andy Fan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2024-06-30 11:24:15 Re: Optimize numeric.c mul_var() using the Karatsuba algorithm
Previous Message Alvaro Herrera 2024-06-30 10:41:46 Re: Optimize numeric.c mul_var() using the Karatsuba algorithm