how to reach D5 in tuplesort.c 's polyphase merge algorithm?

From: 土卜皿 <pengcz(dot)nwpu(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: how to reach D5 in tuplesort.c 's polyphase merge algorithm?
Date: 2014-07-18 22:13:56
Message-ID: CADT5_1_103eMoJ=ay3=O4V4+8O-Dzc=+pTzFEmZhVmqCVwuoNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hi, all
for studying polyphase merge algorithm of tuplesort.c, I use ddd and
apend a table, which has a schema as follows:

CREATE TABLE Towns (
id SERIAL UNIQUE NOT NULL,
code VARCHAR(10) NOT NULL, -- Only unique inside a department
article TEXT,
name TEXT NOT NULL, -- Names are not really unique, for instance
'Sainte-Croix'
department VARCHAR(4) NOT NULL REFERENCES Departments (code),
UNIQUE (code, department)
-- UNIQUE (name, department) -- Not perfectly unique but almost
);

and has 36684 records, and every record is like:
id code article name department
31800 266 \N Machault 77

and for getting into external sort, I type the following command:

select * from towns order by name desc;

but I found it need not reach D5 and D6 during sorting, I thought that the
reason is the amount of runs is 3 (too small) before merging, for generate
more runs, I shuffled the records
when inputting them and got the same result.

so that I want some help, what schema and records do I as least need for
reaching D5 and D6? any advice will be appreciated!

BEST REGAERDS
Dillon

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-07-18 22:26:13 Re: how to reach D5 in tuplesort.c 's polyphase merge algorithm?
Previous Message Tom Lane 2014-07-18 20:27:55 Re: Proposal for updating src/timezone