forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3df51ca
committed
Fix CLUSTER progress reporting of number of blocks scanned.
Previously pg_stat_progress_cluster view reported the current blocknumber in heap scan as the number of heap blocks scanned (i.e.,heap_blks_scanned). This reported number could be incorrect whensynchronize_seqscans is enabled, because it allowed the heap scan tostart at block in middle. This could result in wraparounds in theheap_blks_scanned column when the heap scan wrapped around.This commit fixes the bug by calculating the number of blocks fromthe block that the heap scan starts at to the current block in scan,and reporting that number in the heap_blks_scanned column.Also, in pg_stat_progress_cluster view, previously heap_blks_scannedcould not reach heap_blks_total at the end of heap scan phaseif the last pages scanned were empty. This commit fixes the bug bymanually updating heap_blks_scanned to the same value asheap_blks_total when the heap scan phase finishes.Back-patch to v12 where pg_stat_progress_cluster view was introduced.Reported-by: Matthias van de MeentAuthor: Matthias van de MeentReviewed-by: Fujii MasaoDiscussion:https://postgr.es/m/CAEze2WjCBWSGkVfYag001Rc4+-nNLDpWM7QbyD6yPvuhKs-gYQ@mail.gmail.com1 parentef848f4 commit3df51ca
1 file changed
+27
-2
lines changedLines changed: 27 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
698 | 698 |
| |
699 | 699 |
| |
700 | 700 |
| |
| 701 | + | |
701 | 702 |
| |
702 | 703 |
| |
703 | 704 |
| |
| |||
793 | 794 |
| |
794 | 795 |
| |
795 | 796 |
| |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
796 | 808 |
| |
| 809 | + | |
797 | 810 |
| |
798 | 811 |
| |
799 | 812 |
| |
800 | 813 |
| |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
801 | 819 |
| |
802 |
| - | |
803 |
| - | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
804 | 829 |
| |
805 | 830 |
| |
806 | 831 |
| |
|
0 commit comments
Comments
(0)