Re: CREATE DATABASE ... STRATEGY WAL_LOG issues

2023-03-22 Thread Andres Freund
On 2023-03-22 09:58:58 -0400, Robert Haas wrote: > On Wed, Mar 22, 2023 at 1:12 AM Andres Freund wrote: > > Patch with the two minimal fixes attached. As we don't know whether it's > > worth > > changing the strategy, the more minimal fixes seem more appropriate. > > LGTM. Thanks for checking.

Re: CREATE DATABASE ... STRATEGY WAL_LOG issues

2023-03-22 Thread Robert Haas
On Wed, Mar 22, 2023 at 1:12 AM Andres Freund wrote: > Patch with the two minimal fixes attached. As we don't know whether it's worth > changing the strategy, the more minimal fixes seem more appropriate. LGTM. -- Robert Haas EDB: http://www.enterprisedb.com

Re: CREATE DATABASE ... STRATEGY WAL_LOG issues

2023-03-21 Thread Andres Freund
Hi, On 2023-03-21 09:34:14 -0700, Andres Freund wrote: > On 2023-03-21 11:33:59 -0400, Robert Haas wrote: > > That feels like it would be slightly more rational behavior, > > but I'm not smart enough to guess whether anyone would actually be > > happier (or less happy) after such a change than

Re: CREATE DATABASE ... STRATEGY WAL_LOG issues

2023-03-21 Thread Robert Haas
On Tue, Mar 21, 2023 at 12:34 PM Andres Freund wrote: > More generally, I still think we need logic to use unused buffers even when > strategies are in use Yep. > (my current theory is that we wouldn't increase the > usagecount when strategies use unused buffers, so they can be replaced more >

Re: CREATE DATABASE ... STRATEGY WAL_LOG issues

2023-03-21 Thread Andres Freund
Hi, On 2023-03-21 11:33:59 -0400, Robert Haas wrote: > On Tue, Mar 21, 2023 at 3:01 AM Andres Freund wrote: > > Easy enough to fix and shows clear improvement. One thing I wonder is if > > it's > > worth moving the strategies up one level? Probaly not, but ... > > Hmm, so share a strategy

Re: CREATE DATABASE ... STRATEGY WAL_LOG issues

2023-03-21 Thread Robert Haas
On Tue, Mar 21, 2023 at 3:01 AM Andres Freund wrote: > While hacking on my relation extension patch I found two issues with WAL_LOG: > > 1) RelationCopyStorageUsingBuffer() doesn't free the used strategies. This >means we'll use #relations * ~10k memory Woops. > 2)

CREATE DATABASE ... STRATEGY WAL_LOG issues

2023-03-21 Thread Andres Freund
Hi, While hacking on my relation extension patch I found two issues with WAL_LOG: 1) RelationCopyStorageUsingBuffer() doesn't free the used strategies. This means we'll use #relations * ~10k memory 2) RelationCopyStorageUsingBuffer() gets the buffer for the target relation with