forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit86b8504
committed
tableam: Add table_multi_insert() and revamp/speed-up COPY FROM buffering.
This adds table_multi_insert(), and converts COPY FROM, the only userof heap_multi_insert, to it.A simple conversion of COPY FROM use slots would have yielded aslowdown when inserting into a partitioned table for someworkloads. Different partitions might need different slots (both slottypes and their descriptors), and dropping / creating slots whenthere's constant partition changes is measurable.Thus instead revamp the COPY FROM buffering for partitioned tables toallow to buffer inserts into multiple tables, flushing only whenlimits are reached across all partition buffers. By only droppingslots when there've been inserts into too many different partitions,the aforementioned overhead is gone. By allowing larger batches, evenwhen there are frequent partition changes, we actuall speed such casesup significantly.By using slots COPY of very narrow rows into unlogged / temporarymight slow down very slightly (due to the indirect function calls).Author: David Rowley, Andres Freund, Haribabu KommiDiscussion:https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.dehttps://postgr.es/m/20190327054923.t3epfuewxfqdt22e@alap3.anarazel.de1 parent7bac3ac commit86b8504
File tree
9 files changed
+587
-366
lines changed- src
- backend
- access/heap
- commands
- executor
- include
- access
- nodes
- tools/pgindent
9 files changed
+587
-366
lines changedLines changed: 13 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2106 | 2106 |
| |
2107 | 2107 |
| |
2108 | 2108 |
| |
2109 |
| - | |
| 2109 | + | |
2110 | 2110 |
| |
2111 | 2111 |
| |
2112 | 2112 |
| |
| |||
2127 | 2127 |
| |
2128 | 2128 |
| |
2129 | 2129 |
| |
2130 |
| - | |
| 2130 | + | |
2131 | 2131 |
| |
2132 | 2132 |
| |
2133 |
| - | |
2134 |
| - | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
2135 | 2142 |
| |
2136 | 2143 |
| |
2137 | 2144 |
| |
| |||
2361 | 2368 |
| |
2362 | 2369 |
| |
2363 | 2370 |
| |
2364 |
| - | |
2365 |
| - | |
2366 |
| - | |
2367 |
| - | |
2368 |
| - | |
| 2371 | + | |
2369 | 2372 |
| |
2370 |
| - | |
| 2373 | + | |
2371 | 2374 |
| |
2372 | 2375 |
| |
2373 | 2376 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2516 | 2516 |
| |
2517 | 2517 |
| |
2518 | 2518 |
| |
| 2519 | + | |
2519 | 2520 |
| |
2520 | 2521 |
| |
2521 | 2522 |
| |
|
0 commit comments
Comments
(0)