tuplesort.c

From: Manolo _ <mac_man2005(at)hotmail(dot)it>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: tuplesort.c
Date: 2007-12-13 12:09:35
Message-ID: BAY112-W195A407D21475F33D59E84E6660@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers


http://pastebin.com/f304b279e

",,,the tuple we last output,,,"

What's the problem with just keeping the "the key" of the last output tuple (not the whole tuple)?

I mean, keeping that key will let us writing some incoming tuples (from input) directly into the current run avoiding storing it into the heap. Otherwise we consither those tuples as pending elements to be written into the next run. That implies:
- not writing into the current run a tuple that needs no extra work as the common case (no insertion into the heap, no popping heap's root, no heapifying)
- reduceing the actual heap size in order to build the current run (instead of trying to make each run as long as possible!)

If we think about it on large amount of data... this could save some disk latency time.

Isn't it worth?

Regards, Manolo.

----------------------------------------
> From: bruce(at)momjian(dot)us
> Subject: [HACKERS] Re: Document how to turn off disk write cache on popular operating
> To: magnus(at)hagander(dot)net
> Date: Tue, 11 Dec 2007 08:18:42 -0500
> CC: pgsql-hackers(at)postgreSQL(dot)org
>
> Magnus Hagander wrote:
>> On Mon, Dec 10, 2007 at 02:05:05PM +0000, Bruce Momjian wrote:
>>> Log Message:
>>> -----------
>>> Document how to turn off disk write cache on popular operating systems.
>>>
>>> Modified Files:
>>> --------------
>>> pgsql/doc/src/sgml:
>>> wal.sgml (r1.46 -> r1.47)
>>> (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/wal.sgml?r1=1.46&r2=1.47)
>>
>> Should this mention that you don't need to turn it off at the disk level if
>> you use fsync_writethrough?
>
> Uh, I remember we looked at this checkbox before but I don't remember
> the details, and I can't find a comment about it. Was the issue that
> writethrough always forces through the disk cache? Is that the default
> on Win32? Did we comment this somewhere?
>
> --
> Bruce Momjian http://momjian.us
> EnterpriseDB http://postgres.enterprisedb.com
>
> + If your life is a hard drive, Christ can be your backup. +
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2007-12-13 13:22:05 pgsql: Correct result type of convert_to, per Pavel Stehule.
Previous Message Peter Eisentraut 2007-12-13 11:55:44 pgsql: Clarify log messages

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2007-12-13 12:28:51 Re: [GENERAL] Slow PITR restore
Previous Message Alvaro Herrera 2007-12-13 11:45:18 Re: [HACKERS] "distributed checkpoint"