"Pavan Deolasee" <[EMAIL PROTECTED]> writes: > Isn't the size of the shared buffer pool itself acting as a performance > penalty in this case ? May be StrategyGetBuffer() needs to make multiple > passes over the buffers before the usage_count of any buffer is reduced > to zero and the buffer is chosen as replacement victim.

## Advertising

I read that and thought you were onto something, but it's not acting quite the way I expect. I made a quick hack in StrategyGetBuffer() to count the number of buffers it looks at before finding a victim. Running it with just 32 buffers on a large count(*), the behavior after the initial startup transient is quite odd: got buffer 2 after 4 tries got buffer 3 after 1 tries got buffer 4 after 1 tries got buffer 5 after 1 tries got buffer 6 after 1 tries got buffer 7 after 1 tries got buffer 8 after 1 tries got buffer 12 after 4 tries got buffer 14 after 2 tries got buffer 21 after 7 tries got buffer 26 after 5 tries got buffer 27 after 1 tries got buffer 31 after 4 tries got buffer 0 after 1 tries got buffer 1 after 1 tries got buffer 9 after 8 tries got buffer 10 after 1 tries got buffer 11 after 1 tries got buffer 13 after 2 tries got buffer 15 after 2 tries got buffer 16 after 1 tries got buffer 17 after 1 tries got buffer 18 after 1 tries got buffer 19 after 1 tries got buffer 20 after 1 tries got buffer 22 after 2 tries got buffer 23 after 1 tries got buffer 24 after 1 tries got buffer 25 after 1 tries got buffer 28 after 3 tries got buffer 29 after 1 tries got buffer 30 after 1 tries got buffer 2 after 4 tries got buffer 3 after 1 tries got buffer 4 after 1 tries got buffer 5 after 1 tries got buffer 6 after 1 tries got buffer 7 after 1 tries got buffer 8 after 1 tries got buffer 12 after 4 tries got buffer 14 after 2 tries got buffer 21 after 7 tries got buffer 26 after 5 tries got buffer 27 after 1 tries got buffer 31 after 4 tries got buffer 0 after 1 tries got buffer 1 after 1 tries got buffer 9 after 8 tries got buffer 10 after 1 tries got buffer 11 after 1 tries got buffer 13 after 2 tries got buffer 15 after 2 tries got buffer 16 after 1 tries got buffer 17 after 1 tries got buffer 18 after 1 tries got buffer 19 after 1 tries got buffer 20 after 1 tries got buffer 22 after 2 tries got buffer 23 after 1 tries got buffer 24 after 1 tries got buffer 25 after 1 tries got buffer 28 after 3 tries got buffer 29 after 1 tries got buffer 30 after 1 tries got buffer 2 after 4 tries got buffer 3 after 1 tries got buffer 4 after 1 tries got buffer 5 after 1 tries got buffer 6 after 1 tries got buffer 7 after 1 tries got buffer 8 after 1 tries got buffer 12 after 4 tries got buffer 14 after 2 tries got buffer 21 after 7 tries got buffer 26 after 5 tries got buffer 27 after 1 tries got buffer 31 after 4 tries got buffer 0 after 1 tries got buffer 1 after 1 tries got buffer 9 after 8 tries got buffer 10 after 1 tries got buffer 11 after 1 tries got buffer 13 after 2 tries got buffer 15 after 2 tries got buffer 16 after 1 tries got buffer 17 after 1 tries got buffer 18 after 1 tries got buffer 19 after 1 tries got buffer 20 after 1 tries got buffer 22 after 2 tries got buffer 23 after 1 tries got buffer 24 after 1 tries got buffer 25 after 1 tries got buffer 28 after 3 tries got buffer 29 after 1 tries got buffer 30 after 1 tries got buffer 2 after 4 tries got buffer 3 after 1 tries got buffer 4 after 1 tries got buffer 5 after 1 tries got buffer 6 after 1 tries got buffer 7 after 1 tries got buffer 8 after 1 tries got buffer 12 after 4 tries got buffer 14 after 2 tries got buffer 21 after 7 tries got buffer 26 after 5 tries got buffer 27 after 1 tries got buffer 31 after 4 tries got buffer 0 after 1 tries got buffer 1 after 1 tries got buffer 9 after 8 tries got buffer 10 after 1 tries got buffer 11 after 1 tries got buffer 13 after 2 tries got buffer 15 after 2 tries got buffer 16 after 1 tries got buffer 17 after 1 tries got buffer 18 after 1 tries got buffer 19 after 1 tries got buffer 20 after 1 tries got buffer 22 after 2 tries got buffer 23 after 1 tries got buffer 24 after 1 tries got buffer 25 after 1 tries got buffer 28 after 3 tries got buffer 29 after 1 tries got buffer 30 after 1 tries got buffer 2 after 4 tries got buffer 3 after 1 tries got buffer 4 after 1 tries got buffer 5 after 1 tries got buffer 6 after 1 tries got buffer 7 after 1 tries got buffer 8 after 1 tries got buffer 12 after 4 tries got buffer 14 after 2 tries got buffer 21 after 7 tries got buffer 26 after 5 tries got buffer 27 after 1 tries got buffer 31 after 4 tries got buffer 0 after 1 tries got buffer 1 after 1 tries got buffer 9 after 8 tries got buffer 10 after 1 tries got buffer 11 after 1 tries got buffer 13 after 2 tries got buffer 15 after 2 tries got buffer 16 after 1 tries got buffer 17 after 1 tries got buffer 18 after 1 tries got buffer 19 after 1 tries got buffer 20 after 1 tries got buffer 22 after 2 tries got buffer 23 after 1 tries got buffer 24 after 1 tries got buffer 25 after 1 tries got buffer 28 after 3 tries got buffer 29 after 1 tries got buffer 30 after 1 tries got buffer 2 after 4 tries got buffer 3 after 1 tries got buffer 4 after 1 tries got buffer 5 after 1 tries got buffer 6 after 1 tries got buffer 7 after 1 tries got buffer 8 after 1 tries got buffer 12 after 4 tries got buffer 14 after 2 tries got buffer 21 after 7 tries got buffer 26 after 5 tries got buffer 27 after 1 tries got buffer 31 after 4 tries got buffer 0 after 1 tries got buffer 1 after 1 tries got buffer 9 after 8 tries got buffer 10 after 1 tries got buffer 11 after 1 tries got buffer 13 after 2 tries got buffer 15 after 2 tries got buffer 16 after 1 tries got buffer 17 after 1 tries got buffer 18 after 1 tries got buffer 19 after 1 tries got buffer 20 after 1 tries got buffer 22 after 2 tries got buffer 23 after 1 tries got buffer 24 after 1 tries got buffer 25 after 1 tries got buffer 28 after 3 tries got buffer 29 after 1 tries got buffer 30 after 1 tries got buffer 2 after 4 tries got buffer 3 after 1 tries got buffer 4 after 1 tries got buffer 5 after 1 tries got buffer 6 after 1 tries got buffer 7 after 1 tries got buffer 8 after 1 tries got buffer 12 after 4 tries got buffer 14 after 2 tries got buffer 21 after 7 tries got buffer 26 after 5 tries got buffer 27 after 1 tries got buffer 31 after 4 tries got buffer 0 after 1 tries got buffer 1 after 1 tries got buffer 9 after 8 tries got buffer 10 after 1 tries got buffer 11 after 1 tries got buffer 13 after 2 tries got buffer 15 after 2 tries got buffer 16 after 1 tries got buffer 17 after 1 tries got buffer 18 after 1 tries got buffer 19 after 1 tries got buffer 20 after 1 tries got buffer 22 after 2 tries got buffer 23 after 1 tries got buffer 24 after 1 tries got buffer 25 after 1 tries got buffer 28 after 3 tries got buffer 29 after 1 tries got buffer 30 after 1 tries got buffer 2 after 4 tries got buffer 3 after 1 tries got buffer 4 after 1 tries got buffer 5 after 1 tries got buffer 6 after 1 tries got buffer 7 after 1 tries got buffer 8 after 1 tries got buffer 12 after 4 tries got buffer 14 after 2 tries got buffer 21 after 7 tries got buffer 26 after 5 tries got buffer 27 after 1 tries got buffer 31 after 4 tries got buffer 0 after 1 tries got buffer 1 after 1 tries got buffer 9 after 8 tries got buffer 10 after 1 tries got buffer 11 after 1 tries got buffer 13 after 2 tries got buffer 15 after 2 tries got buffer 16 after 1 tries got buffer 17 after 1 tries got buffer 18 after 1 tries got buffer 19 after 1 tries got buffer 20 after 1 tries got buffer 22 after 2 tries got buffer 23 after 1 tries got buffer 24 after 1 tries got buffer 25 after 1 tries got buffer 28 after 3 tries got buffer 29 after 1 tries got buffer 30 after 1 tries got buffer 2 after 4 tries Yes, autovacuum is off, and bgwriter shouldn't have anything useful to do either, so I'm a bit at a loss what's going on --- but in any case, it doesn't look like we are cycling through the entire buffer space for each fetch. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq