Re: Replacement Selection

From: <mac_man2005(at)hotmail(dot)it>
To: "Timothy J(dot) Kordas" <tkordas(at)greenplum(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Replacement Selection
Date: 2007-12-01 09:38:08
Message-ID: BAY132-DS29B97B01D7C8267DECC12E6720@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> in puttuple_common(), the transition from an internal to external sort is
> performed at the bottom of the TSS_INITIAL case in the main switch
> statement.

The transition? Do we internal sort somewhere else and then external sort
here in tuplesort.c?

> The function dumptuples() heapifies the in-core tuples (divides the
> in-core tuples into initial runs and then advances the state to
> TSS_BUILDRUNS).

Cannot see where dumptuples() "advances the state to TSS_BUILDRUNS".
I expected something like
state->status = TSS_BUILDRUNS;
executed through dumptuples()

>
> I recommend you run the code in the debugger on a external-sorting query:
> watch two or three tuples go into the heap and you'll get the idea.
>
> The top of the heap is at state->memtuples[0] the heap goes down from
> there. New tuples are added there and the heap is adjusted (Using the
> tuplesort_heap_siftup() function).
>
> -Tim
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-12-01 11:25:59 Re: Replacement Selection
Previous Message Heikki Linnakangas 2007-12-01 09:06:41 Re: Release Note Changes