Re: Create TOAST table only if AM needs

2019-05-21 Thread Robert Haas
On Tue, May 21, 2019 at 11:53 AM Andres Freund wrote: > Assuming you didn't sneakily change the content of > heapam_relation_needs_toast_table from its previous behaviour, this > looks good to me ;) git diff --color-moved=zebra says I didn't. Committed; thanks for the review. -- Robert Haas En

Re: Create TOAST table only if AM needs

2019-05-21 Thread Andres Freund
Hi, On 2019-05-20 10:29:29 -0400, Robert Haas wrote: > From 4e361bfe51810d7c637bf57968da2dfea4197701 Mon Sep 17 00:00:00 2001 > From: Robert Haas > Date: Fri, 17 May 2019 16:01:47 -0400 > Subject: [PATCH v2] tableam: Move heap-specific logic from needs_toast_table > below tableam. Assuming you

Re: Create TOAST table only if AM needs

2019-05-20 Thread Robert Haas
On Fri, May 17, 2019 at 5:12 PM Ashwin Agrawal wrote: >> I'd rather see this have a relation_ prefix. > > +1 to overall patch with that comment incorporated. This seems simple enough > to incorporate for v12. Though stating that blind-folded with what else is > remaining to be must done for v12.

Re: Create TOAST table only if AM needs

2019-05-19 Thread Greg Stark
Just throwing this out there Perhaps we should just disable toasting for non-heap tables entirely for now? That way at least people can use it and storage plugins just have to be able to deal with large datums in their own (or throw errors). On Fri., May 17, 2019, 5:56 p.m. Ashwin Agrawal, w

Re: Create TOAST table only if AM needs

2019-05-17 Thread Ashwin Agrawal
On Fri, May 17, 2019 at 2:42 PM Robert Haas wrote: > In any case, it bears saying that > tableam is a remarkable accomplishment regardless of whatever > shortcomings it has in this area or elsewhere. > Big +1 to this.

Re: Create TOAST table only if AM needs

2019-05-17 Thread Robert Haas
On Fri, May 17, 2019 at 3:28 PM Andres Freund wrote: > > - If your AM uses some system other than TOAST to store large values, > > you are out of luck. You will get TOAST tables whether you want them > > or not. > > Which is aesthetically and indode usage wise annoying, but not > *terrible*. You

Re: Create TOAST table only if AM needs

2019-05-17 Thread Ashwin Agrawal
On Fri, May 17, 2019 at 11:34 AM Andres Freund wrote: > Hi, > > On 2019-05-17 11:26:29 -0700, Ashwin Agrawal wrote: > > Currently TOAST table is always created (if needed based on data type > > properties) independent of table AM. How toasting is handled seems > > should be AM responsibility. Gen

Re: Create TOAST table only if AM needs

2019-05-17 Thread Ashwin Agrawal
On Fri, May 17, 2019 at 1:51 PM Andres Freund wrote: > > > /* > > > * Planner related callbacks for the heap AM > > @@ -2558,6 +2615,8 @@ static const TableAmRoutine heapam_methods = { > > > > .relation_estimate_siz

Re: Create TOAST table only if AM needs

2019-05-17 Thread Andres Freund
Hi, > + > +/* > + * Check to see whether the table needs a TOAST table. It does only if > + * (1) there are any toastable attributes, and (2) the maximum length > + * of a tuple could exceed TOAST_TUPLE_THRESHOLD. (We don't want to > + * create a toast table for something like "f1 varchar(20)".)

Re: Create TOAST table only if AM needs

2019-05-17 Thread Robert Haas
On Fri, May 17, 2019 at 3:26 PM Tom Lane wrote: > It seems to me that the entire tableam project is still very much WIP, > and if anybody is able to do anything actually useful with a different > AM right at the moment, that's just mighty good fortune for them. > It's way too late to be making des

Re: Create TOAST table only if AM needs

2019-05-17 Thread Andres Freund
On 2019-05-17 15:26:38 -0400, Tom Lane wrote: > Robert Haas writes: > > So I think this basically just doesn't work right now. I am > > sympathetic to Andres's position that we shouldn't go whacking the > > code around too much at this late date, and he's probably right that > > we're going to fi

Re: Create TOAST table only if AM needs

2019-05-17 Thread Andres Freund
Hi, On 2019-05-17 15:13:50 -0400, Robert Haas wrote: > On Fri, May 17, 2019 at 2:34 PM Andres Freund wrote: > > Yea, Robert is also working on this. In fact, we were literally chatting > > about it a few minutes ago. He'll probably chime in too. > > Yeah, I'm aiming to post a patch set very soon

Re: Create TOAST table only if AM needs

2019-05-17 Thread Tom Lane
Robert Haas writes: > So I think this basically just doesn't work right now. I am > sympathetic to Andres's position that we shouldn't go whacking the > code around too much at this late date, and he's probably right that > we're going to find lots of other problems with tableam as well and > you

Re: Create TOAST table only if AM needs

2019-05-17 Thread Robert Haas
On Fri, May 17, 2019 at 2:34 PM Andres Freund wrote: > Yea, Robert is also working on this. In fact, we were literally chatting > about it a few minutes ago. He'll probably chime in too. Yeah, I'm aiming to post a patch set very soon that does a bunch of refactoring of the TOAST stuff to make lif

Re: Create TOAST table only if AM needs

2019-05-17 Thread Andres Freund
Hi, On 2019-05-17 11:26:29 -0700, Ashwin Agrawal wrote: > Currently TOAST table is always created (if needed based on data type > properties) independent of table AM. How toasting is handled seems > should be AM responsibility. Generic code shouldn't force the use of > the separate table for the s

Create TOAST table only if AM needs

2019-05-17 Thread Ashwin Agrawal
tion to AM. From fcbf6b8187ef8389cf38cd185b709bcb6ef1152a Mon Sep 17 00:00:00 2001 From: Ashwin Agrawal Date: Fri, 10 May 2019 17:42:06 -0700 Subject: [PATCH 1/1] Create toast table only if AM needs it. All AM may not need toast table, hence add property to TableAmRoutine to define if uses toas