forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit55918f7
committed
Remove arbitrary cap on read_stream.c buffer queue.
Previously the internal queue of buffers was capped at max_ios * 4,though not less than io_combine_limit, at allocation time. That wasdone in the first version based on conservative theories about resourceusage and heuristics pending later work. The configured I/O depth couldnot always be reached with dense random streams generated by ANALYZE,VACUUM, the proposed Bitmap Heap Scan patch, and also sequential streamswith the proposed AIO subsystem to name some examples.The new formula is (max_ios + 1) * io_combine_limit, enough buffers forthe full configured I/O concurrency level using the full configured I/Ocombine size, plus the buffers from one finished but not yet consumedfull-sized I/O. Significantly more memory would be needed for high GUCvalues if the client code requests a large per-buffer data size, butthat is discouraged (existing and proposed stream users try to keep itunder a few words, if not zero).With this new formula, an intermediate variable could have overflowedunder maximum GUC values, so its data type is adjusted to cope.Discussion:https://postgr.es/m/CA%2BhUKGK_%3D4CVmMHvsHjOVrK6t4F%3DLBpFzsrr3R%2BaJYN8kcTfWg%40mail.gmail.com1 parent48e4ae9 commit55918f7
1 file changed
+11
-7
lines changedLines changed: 11 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
447 | 447 |
| |
448 | 448 |
| |
449 | 449 |
| |
450 |
| - | |
451 |
| - | |
452 |
| - | |
453 |
| - | |
454 |
| - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
455 | 459 |
| |
456 |
| - | |
| 460 | + | |
457 | 461 |
| |
458 | 462 |
| |
459 | 463 |
| |
| |||
725 | 729 |
| |
726 | 730 |
| |
727 | 731 |
| |
728 |
| - | |
| 732 | + | |
729 | 733 |
| |
730 | 734 |
| |
731 | 735 |
| |
|
0 commit comments
Comments
(0)