Re: [HACKERS] \dt and disk access - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] \dt and disk access
Date
Msg-id 7195cb918ada313c3eb246c957b7e075
Whole thread Raw
In response to [HACKERS] \dt and disk access  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
>     Why use shared memory for this?  Why not use mmap() for it?  Come
> to think of it, mmap()'ng it would have better scalability, no?  If you
> already know the result size (ie. 256k), you could that have the code try
> to mmap() that amount of memory to do the sort in.  If the mmap() fails,
> revert to using a file...now the result size of the SELECT doesn't have a
> compiled in "limit" to the size of memory used for the sort...its restricted
> to the amount of memory on the machine (ie. if I double the RAM, I should be
> able to have double the results sorted in memory instead of one disk)

I don't think we need mmap() because we never need to put it on disk.
Just palloc() the memory.


>
>     Add a flag over top of that, like -B, that states the *max* result
> size to do an in-memory sort with...or, rather, the *max* to try to do one
> with.
>
> Marc G. Fournier
> Systems Administrator @ hub.org
> primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org
>
>


- --
Bruce Momjian
maillist@candle.pha.pa.us

------------------------------

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] \dt and disk access
Next
From: Bruce Momjian
Date:
Subject: [HACKERS] Re: PostgreSQL psort() function performance (fwd)