Re: COPY FROM WHEN condition
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>, Surafel Temesgen <surafel3000@gmail.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, Adam Berlin <berlin.ab@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Haribabu Kommi <kommi.haribabu@gmail.com>
Date: 2019-04-04T23:31:54Z
Lists: pgsql-hackers
Hi, On 2019-04-04 12:04:28 -0700, Andres Freund wrote: > On 2019-04-03 22:20:00 -0700, Andres Freund wrote: > > On 2019-04-03 20:00:09 +1300, David Rowley wrote: > > > Oops, I forgot about that one. v4 attached. > > > > I'm pretty happy with this. I'm doing some minor changes (e.g. don't > > like the function comment formatting that much, the tableam callback > > needs docs, stuff like that), and then I'm going to push it tomorrow. > > After another read, I also think I'm going to rename the functions a > bit. CopyMultiInsertInfo_SetupBuffer, with its mix of camel-case and > underscores, just doesn't seem to mix well with copy.c and also just > generally other postgres code. I feel we already have too many different > naming conventions... I've pushed this now. Besides those naming changes, I'd to re-add the zero initialization (I did end up seing compiler warnings when compiling with optimizations). Also some comment fixes. I added one more flush location, when inserting into a partition that cannot use batching - there might e.g. be triggers looking at rows in other partitions or such. I found some pretty minor slowdown for COPYing narrow rows into an unlogged unpartitioned table. That got better by combining the loops in CopyMultiInsertBufferFlush() (previously there were stalls due to the indirect function calls for ExecCleartuple()). I think there's still a tiny slowdown left in that scenario, but given that it's unlogged and very narrow rows, I think that's ok. Greetings, Andres Freund
Commits
-
Remove unused struct member, enforce multi_insert callback presence.
- 57a7a3adfe4e 12.0 landed
-
Separate per-batch and per-tuple memory contexts in COPY
- 36a1281f86c0 12.0 landed
-
Fix handling of volatile expressions in COPY FROM ... WHERE
- 4a8283d0ec5a 12.0 landed
-
Allow COPY FROM to filter data using WHERE conditions
- 31f3817402da 12.0 landed
-
Remove obsolete netbsd dynloader code
- b68ff3ea672c 12.0 cited