Re: SQL select query becomes slow when using limit (with no offset)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robert Haas wrote:
On Mon, Aug 10, 2009 at 11:19 AM, Kevin Grittner<Kevin.Grittner@xxxxxxxxxxxx> wrote:
(2)  Somehow use effective_cache_size in combination with some sort of
current activity metrics to dynamically adjust random access costs.
(I know, that one's total hand-waving, but it seems to have some
possibility of better modeling reality than what we currently do.)

I was disappointed when I learned that effective_cache_size doesn't get generally used to predict the likelihood of a buffer fetch requiring physical io.

Yeah, I gave a lightning talk on this at PGcon, but I haven't had time
to do anything with it.  There are a couple of problems.  One is that
you have to have a source for your current activity metrics.  Since a
lot of the pages of interest will be in the OS buffer pool rather than
PG shared buffers, there's no easy way to handle this

While there are portability concerns, mmap + mincore works across BSD, Linux, Solaris and will return a vector of file pages in the OS buffer pool. So it's certainly possible that on supported systems, an activity monitor can have direct knowledge of OS caching effectiveness on a per relation/index basis.

--
-Devin

--
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux