Commit 0e52903
committed
Simplify loop logic in nodeIncrementalSort.c.
The inner loop in switchToPresortedPrefixMode() can be implemented
as a conventional integer-counter for() loop, removing a couple of
redundant boolean state variables. The old logic here was a remnant
of earlier development, but as things now stand there's no reason
for extra complexity.
Also, annotate the test case added by 82e0e29 to explain why it
manages to hit the corner case fixed in that commit, and add an
EXPLAIN to verify that it's creating an incremental-sort plan.
Back-patch to v13, like the previous patch.
James Coleman and Tom Lane
Discussion: https://postgr.es/m/16846-ae49f51ac379a4cb@postgresql.org1 parent 54e51dc commit 0e52903
File tree
3 files changed
+30
-34
lines changed- src
- backend/executor
- test/regress
- expected
- sql
3 files changed
+30
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
292 | | - | |
293 | | - | |
| 291 | + | |
294 | 292 | | |
295 | 293 | | |
296 | 294 | | |
| |||
343 | 341 | | |
344 | 342 | | |
345 | 343 | | |
346 | | - | |
| 344 | + | |
347 | 345 | | |
348 | | - | |
349 | | - | |
350 | 346 | | |
351 | 347 | | |
352 | 348 | | |
353 | 349 | | |
354 | 350 | | |
355 | | - | |
| 351 | + | |
356 | 352 | | |
357 | 353 | | |
358 | | - | |
359 | | - | |
360 | 354 | | |
361 | 355 | | |
362 | 356 | | |
| |||
376 | 370 | | |
377 | 371 | | |
378 | 372 | | |
379 | | - | |
380 | 373 | | |
381 | 374 | | |
382 | 375 | | |
| |||
395 | 388 | | |
396 | 389 | | |
397 | 390 | | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
| 391 | + | |
404 | 392 | | |
405 | 393 | | |
406 | 394 | | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | 395 | | |
420 | 396 | | |
421 | 397 | | |
| |||
428 | 404 | | |
429 | 405 | | |
430 | 406 | | |
431 | | - | |
| 407 | + | |
432 | 408 | | |
433 | 409 | | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
439 | 416 | | |
440 | 417 | | |
441 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
679 | 694 | | |
680 | 695 | | |
681 | 696 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
153 | 157 | | |
154 | 158 | | |
155 | 159 | | |
| |||
0 commit comments