Commit 6443da3
committed
db/import: Consolidate PostgreSQL memory config with dynamic scaling
- Add session-level import optimization function to migration
(admin.set_optimal_import_session_settings) that boosts work_mem
and maintenance_work_mem during batch imports
- Consolidate all PostgreSQL memory settings into single source of truth:
- DB_MEM_LIMIT in .env.config drives all derived values
- CLI calculates: shared_buffers (25%), effective_cache_size (75%),
maintenance_work_mem (25%), work_mem (1%), temp_buffers (12.5%),
wal_buffers (1.5%)
- start-postgres.sh applies settings via command-line flags
- Fix temp_buffers runtime error: move from session-level SET to
server startup (cannot be changed after temp tables are accessed)
- Add wal_buffers to dynamic scaling (was hardcoded at 64MB)
- Remove obsolete hotpatch files (now integrated into migrations)
- Delete redundant migrations that were created with future timestamps1 parent 6d76c73 commit 6443da3
File tree
13 files changed
+127
-464
lines changed- cli/src
- doc/performance
- migrations
- postgres
- sql/hotpatches
- test
- expected
- sql
13 files changed
+127
-464
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| 195 | + | |
| 196 | + | |
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
198 | 200 | | |
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
202 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
203 | 207 | | |
204 | 208 | | |
205 | 209 | | |
| |||
396 | 400 | | |
397 | 401 | | |
398 | 402 | | |
399 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
400 | 414 | | |
401 | 415 | | |
402 | 416 | | |
403 | 417 | | |
404 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
405 | 425 | | |
406 | 426 | | |
407 | 427 | | |
| |||
411 | 431 | | |
412 | 432 | | |
413 | 433 | | |
414 | | - | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
415 | 437 | | |
416 | 438 | | |
417 | 439 | | |
| |||
606 | 628 | | |
607 | 629 | | |
608 | 630 | | |
609 | | - | |
| 631 | + | |
610 | 632 | | |
611 | 633 | | |
612 | 634 | | |
613 | 635 | | |
614 | 636 | | |
615 | 637 | | |
616 | 638 | | |
| 639 | + | |
| 640 | + | |
617 | 641 | | |
618 | 642 | | |
619 | 643 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
178 | 232 | | |
179 | 233 | | |
180 | 234 | | |
181 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
182 | 245 | | |
183 | 246 | | |
184 | 247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| |||
0 commit comments