Re: non-bulk inserts and tuple routing

2018-03-04 Thread Amit Langote
On 2018/03/03 13:48, Andres Freund wrote: > On 2018-02-22 11:10:57 -0500, Robert Haas wrote: >> On Tue, Feb 20, 2018 at 8:06 PM, Amit Langote >> wrote: Attached is an updated version for that. >>> >>> Thanks for updating the patch. >> >> Committed with a few

Re: non-bulk inserts and tuple routing

2018-03-04 Thread Amit Langote
On 2018/03/03 13:38, Andres Freund wrote: > Hi, > > On 2018-02-22 11:10:57 -0500, Robert Haas wrote: >> On Tue, Feb 20, 2018 at 8:06 PM, Amit Langote >> wrote: Attached is an updated version for that. >>> >>> Thanks for updating the patch. >> >> Committed with

Re: non-bulk inserts and tuple routing

2018-03-02 Thread Andres Freund
On 2018-02-22 11:10:57 -0500, Robert Haas wrote: > On Tue, Feb 20, 2018 at 8:06 PM, Amit Langote > wrote: > >> Attached is an updated version for that. > > > > Thanks for updating the patch. > > Committed with a few changes. The big one was that I got rid of the >

Re: non-bulk inserts and tuple routing

2018-03-02 Thread Andres Freund
Hi, On 2018-02-22 11:10:57 -0500, Robert Haas wrote: > On Tue, Feb 20, 2018 at 8:06 PM, Amit Langote > wrote: > >> Attached is an updated version for that. > > > > Thanks for updating the patch. > > Committed with a few changes. The big one was that I got rid of

Re: non-bulk inserts and tuple routing

2018-02-22 Thread Amit Langote
On 2018/02/23 1:10, Robert Haas wrote: > On Tue, Feb 20, 2018 at 8:06 PM, Amit Langote > wrote: >>> Attached is an updated version for that. >> >> Thanks for updating the patch. > > Committed with a few changes. The big one was that I got rid of the > local

Re: non-bulk inserts and tuple routing

2018-02-22 Thread Amit Langote
On 2018/02/23 1:53, Alvaro Herrera wrote: > Robert Haas wrote: >> On Tue, Feb 20, 2018 at 8:06 PM, Amit Langote >> wrote: Attached is an updated version for that. >>> >>> Thanks for updating the patch. >> >> Committed with a few changes. > > I propose to tweak

Re: non-bulk inserts and tuple routing

2018-02-22 Thread Robert Haas
On Thu, Feb 22, 2018 at 11:53 AM, Alvaro Herrera wrote: > Robert Haas wrote: >> On Tue, Feb 20, 2018 at 8:06 PM, Amit Langote >> wrote: >> >> Attached is an updated version for that. >> > >> > Thanks for updating the patch. >> >> Committed

Re: non-bulk inserts and tuple routing

2018-02-22 Thread Alvaro Herrera
Robert Haas wrote: > On Tue, Feb 20, 2018 at 8:06 PM, Amit Langote > wrote: > >> Attached is an updated version for that. > > > > Thanks for updating the patch. > > Committed with a few changes. I propose to tweak a few comments to PartitionTupleRouting, as

Re: non-bulk inserts and tuple routing

2018-02-22 Thread Robert Haas
On Tue, Feb 20, 2018 at 8:06 PM, Amit Langote wrote: >> Attached is an updated version for that. > > Thanks for updating the patch. Committed with a few changes. The big one was that I got rid of the local variable is_update in ExecSetupPartitionTupleRouting.

Re: non-bulk inserts and tuple routing

2018-02-20 Thread Amit Langote
Fujita-san, On 2018/02/20 19:40, Etsuro Fujita wrote: > (2018/02/19 13:19), Amit Langote wrote: >> Attached rebased patch. > > Thanks for the rebased patch! > > One thing I noticed while updating the > tuple-routing-for-foreign-partitions patch on top of this is: we should > switch into the

Re: non-bulk inserts and tuple routing

2018-02-18 Thread Amit Langote
Fujita-san, On 2018/02/16 19:50, Etsuro Fujita wrote: > (2018/02/16 18:23), Amit Langote wrote: >> Good idea. Done. > Thanks.  I fixed a typo (s/Converti/Convert/) and adjusted these comments > a bit further to match the preceding code/comments.  Attached is the > updated version. Thank you for

Re: non-bulk inserts and tuple routing

2018-02-16 Thread Etsuro Fujita
(2018/02/16 18:23), Amit Langote wrote: On 2018/02/16 18:12, Etsuro Fujita wrote: In the patch you added the comments: + wcoList = linitial(node->withCheckOptionLists); + + /* +* Convert Vars in it to contain this partition's attribute numbers. +* Use the WITH CHECK

Re: non-bulk inserts and tuple routing

2018-02-16 Thread Amit Langote
Fujita-san, Thanks for the review. On 2018/02/16 18:12, Etsuro Fujita wrote: > (2018/02/16 13:42), Amit Langote wrote: >> Attached v9.  Thanks a for the review! > > Thanks for the updated patch!  In the patch you added the comments: > > +   wcoList = linitial(node->withCheckOptionLists); >

Re: non-bulk inserts and tuple routing

2018-02-16 Thread Etsuro Fujita
(2018/02/16 13:42), Amit Langote wrote: On 2018/02/16 12:41, Etsuro Fujita wrote: (2018/02/16 10:49), Amit Langote wrote: I think you're right. If node->returningLists is non-NULL at all, ExecInitModifyTable() would've initialized the needed slot and expression context. I added Assert()s to

Re: non-bulk inserts and tuple routing

2018-02-15 Thread Amit Langote
On 2018/02/16 12:41, Etsuro Fujita wrote: > (2018/02/16 10:49), Amit Langote wrote: >> I think you're right.  If node->returningLists is non-NULL at all, >> ExecInitModifyTable() would've initialized the needed slot and expression >> context.  I added Assert()s to that affect. > > OK, but one

Re: non-bulk inserts and tuple routing

2018-02-15 Thread Etsuro Fujita
(2018/02/16 10:49), Amit Langote wrote: On 2018/02/15 21:10, Etsuro Fujita wrote: here are some minor comments: o On changes to ExecCleanupTupleRouting: - ExecCloseIndices(resultRelInfo); - heap_close(resultRelInfo->ri_RelationDesc, NoLock); + if (resultRelInfo) + { +

Re: non-bulk inserts and tuple routing

2018-02-15 Thread Amit Langote
Fujita-san, Thanks for the review. On 2018/02/15 21:10, Etsuro Fujita wrote: > (2018/02/13 10:12), Amit Langote wrote: >> Updated patch is attached. > > Thanks, here are some minor comments: > > o On changes to ExecCleanupTupleRouting: > > -   ExecCloseIndices(resultRelInfo); > -  

Re: non-bulk inserts and tuple routing

2018-02-15 Thread Etsuro Fujita
(2018/02/13 10:12), Amit Langote wrote: On 2018/02/09 21:20, Etsuro Fujita wrote: * Please add a brief decsription about partition_oids to the comments for this struct. @@ -91,6 +91,7 @@ typedef struct PartitionTupleRouting { PartitionDispatch *partition_dispatch_info; int

Re: non-bulk inserts and tuple routing

2018-02-12 Thread Amit Langote
Fujita-san, Thanks for the review. On 2018/02/09 21:20, Etsuro Fujita wrote: >>> * Please add a brief decsription about partition_oids to the comments for >>> this struct. >>> >>> @@ -91,6 +91,7 @@ typedef struct PartitionTupleRouting >>>   { >>> PartitionDispatch *partition_dispatch_info;

Re: non-bulk inserts and tuple routing

2018-02-09 Thread Etsuro Fujita
(2018/02/09 14:32), Amit Langote wrote: I had mistakenly tagged these patches v24, but they were actually supposed to be v5. So the attached updated patch is tagged v6. OK. On 2018/02/07 19:36, Etsuro Fujita wrote: (2018/02/05 14:34), Amit Langote wrote: The code in

Re: non-bulk inserts and tuple routing

2018-02-09 Thread Etsuro Fujita
(2018/02/08 23:21), Robert Haas wrote: On Thu, Feb 8, 2018 at 5:16 AM, Etsuro Fujita wrote: if (resultRelInfo == NULL); { /* Initialize partition info. */ resultRelInfo = ExecInitPartitionInfo(mtstate,

Re: non-bulk inserts and tuple routing

2018-02-08 Thread Amit Langote
Fujita-san, Thanks a lot for the review. I had mistakenly tagged these patches v24, but they were actually supposed to be v5. So the attached updated patch is tagged v6. On 2018/02/07 19:36, Etsuro Fujita wrote: >> (2018/02/05 14:34), Amit Langote wrote: >>> The code in

Re: non-bulk inserts and tuple routing

2018-02-08 Thread Robert Haas
On Thu, Feb 8, 2018 at 5:16 AM, Etsuro Fujita wrote: > if (resultRelInfo == NULL); > { > /* Initialize partition info. */ > resultRelInfo = ExecInitPartitionInfo(mtstate, > saved_resultRelInfo, >

Re: non-bulk inserts and tuple routing

2018-02-08 Thread Etsuro Fujita
(2018/02/07 19:36), Etsuro Fujita wrote: (2018/02/05 19:43), Etsuro Fujita wrote: (2018/02/05 14:34), Amit Langote wrote: Here is the updated version that contains two patches as described above. Here are some minor comments: o On changes to ExecInsert * This might be just my taste, but I

Re: non-bulk inserts and tuple routing

2018-02-07 Thread Etsuro Fujita
(2018/02/05 19:43), Etsuro Fujita wrote: (2018/02/05 14:34), Amit Langote wrote: The code in tupconv_map_for_subplan() currently assumes that it can rely on all leaf partitions having been initialized. On reflection I noticed this analysis is not 100% correct; I think what that function

Re: non-bulk inserts and tuple routing

2018-02-05 Thread Amit Langote
On 2018/02/05 19:43, Etsuro Fujita wrote: > (2018/02/05 14:34), Amit Langote wrote: >> On 2018/02/02 19:56, Etsuro Fujita wrote: >>> * In ExecInitPartitionResultRelInfo: >>> +   /* >>> +    * Note that the entries in this list appear in no predetermined >>> +    * order as result of

Re: non-bulk inserts and tuple routing

2018-02-05 Thread Etsuro Fujita
(2018/02/05 14:34), Amit Langote wrote: On 2018/02/02 19:56, Etsuro Fujita wrote: * ExecInitPartitionResultRelInfo is called from ExecFindPartition, but we could call that another way; in ExecInsert/CopyFrom we call that after ExecFindPartition if the partition chosen by ExecFindPartition has

Re: non-bulk inserts and tuple routing

2018-02-04 Thread Amit Langote
Fujita-san, Thank you for the review. On 2018/02/02 19:56, Etsuro Fujita wrote: > (2018/01/30 18:52), Etsuro Fujita wrote: >> (2018/01/30 18:39), Amit Langote wrote: >>> Will wait for your comments before sending a new version then. >> >> Ok, I'll post my comments as soon as possible. > > *

Re: non-bulk inserts and tuple routing

2018-02-02 Thread Etsuro Fujita
(2018/01/30 18:52), Etsuro Fujita wrote: (2018/01/30 18:39), Amit Langote wrote: Will wait for your comments before sending a new version then. Ok, I'll post my comments as soon as possible. * ExecInitPartitionResultRelInfo is called from ExecFindPartition, but we could call that another

Re: non-bulk inserts and tuple routing

2018-01-30 Thread Etsuro Fujita
(2018/01/30 18:39), Amit Langote wrote: Will wait for your comments before sending a new version then. Ok, I'll post my comments as soon as possible. Best regards, Etsuro Fujita

Re: non-bulk inserts and tuple routing

2018-01-30 Thread Amit Langote
Fujita-san, On 2018/01/30 18:22, Etsuro Fujita wrote: > (2018/01/25 18:52), Amit Langote wrote: >> On 2018/01/25 18:30, Etsuro Fujita wrote: >>> The patches apply cleanly and compile successfully, but make check fails >>> in an assert-enabled build. >> >> Hmm, I can't seem to reproduce the

Re: non-bulk inserts and tuple routing

2018-01-30 Thread Etsuro Fujita
(2018/01/25 18:52), Amit Langote wrote: On 2018/01/25 18:30, Etsuro Fujita wrote: The patches apply cleanly and compile successfully, but make check fails in an assert-enabled build. Hmm, I can't seem to reproduce the failure with v4 patches I posted earlier today. Can you please post the

Re: non-bulk inserts and tuple routing

2018-01-25 Thread Etsuro Fujita
(2018/01/25 18:52), Amit Langote wrote: On 2018/01/25 18:30, Etsuro Fujita wrote: The patches apply cleanly and compile successfully, but make check fails in an assert-enabled build. Hmm, I can't seem to reproduce the failure with v4 patches I posted earlier today. ===

Re: non-bulk inserts and tuple routing

2018-01-25 Thread Amit Langote
Fujita-san, Thanks for the review. On 2018/01/25 18:30, Etsuro Fujita wrote: > (2018/01/25 11:11), Amit Langote wrote: >> Rebased again. > > Thanks for the rebased patch! > > The patches apply cleanly and compile successfully, but make check fails > in an assert-enabled build. Hmm, I can't

Re: non-bulk inserts and tuple routing

2018-01-25 Thread Etsuro Fujita
(2018/01/25 11:11), Amit Langote wrote: Rebased again. Thanks for the rebased patch! The patches apply cleanly and compile successfully, but make check fails in an assert-enabled build. Best regards, Etsuro Fujita

Re: non-bulk inserts and tuple routing

2018-01-24 Thread Amit Langote
On 2018/01/24 17:25, Amit Langote wrote: > On 2018/01/20 7:07, Robert Haas wrote: >> On Fri, Jan 19, 2018 at 3:56 AM, Amit Langote wrote: >>> I rebased the patches, since they started conflicting with a recently >>> committed patch [1]. >> >> I think that my latest commit has managed to break this

Re: non-bulk inserts and tuple routing

2018-01-19 Thread Robert Haas
On Fri, Jan 19, 2018 at 3:56 AM, Amit Langote wrote: > I rebased the patches, since they started conflicting with a recently > committed patch [1]. I think that my latest commit has managed to break this pretty thoroughly. -- Robert Haas EnterpriseDB:

Re: non-bulk inserts and tuple routing

2017-12-19 Thread Amit Langote
Hi Ashutosh. On 2017/12/19 19:12, Ashutosh Bapat wrote: > On Tue, Dec 19, 2017 at 3:36 PM, Amit Langote > wrote: >> >> * Bulk-inserting 100,000 rows using COPY: >> >> copy t1 from '/tmp/t1.csv' csv; >> >> * Times in milliseconds: >> >> #parts HEAD

Re: non-bulk inserts and tuple routing

2017-12-19 Thread Ashutosh Bapat
On Tue, Dec 19, 2017 at 3:36 PM, Amit Langote wrote: > > * Bulk-inserting 100,000 rows using COPY: > > copy t1 from '/tmp/t1.csv' csv; > > * Times in milliseconds: > > #parts HEADPatched > > 8458.301450.875 > 16