tuplesort.c - Mailing list pgsql-hackers

From Manolo _
Subject tuplesort.c
Date
Msg-id BAY112-W195A407D21475F33D59E84E6660@phx.gbl
Whole thread Raw
In response to Re: Document how to turn off disk write cache on popular operating  (Bruce Momjian <bruce@momjian.us>)
List 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
storingit 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
poppingheap'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@momjian.us
> Subject: [HACKERS] Re: Document how to turn off disk write cache on popular operating
> To: magnus@hagander.net
> Date: Tue, 11 Dec 2007 08:18:42 -0500
> CC: pgsql-hackers@postgreSQL.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/

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [DOCS] "distributed checkpoint"
Next
From: Heikki Linnakangas
Date:
Subject: Re: [GENERAL] Slow PITR restore