|
133 | 133 | #include "utils/pg_locale.h"
|
134 | 134 | #include "utils/rel.h"
|
135 | 135 | #include "utils/selfuncs.h"
|
| 136 | +#include "utils/snapmgr.h" |
136 | 137 | #include "utils/spccache.h"
|
137 | 138 | #include "utils/syscache.h"
|
138 | 139 | #include "utils/timestamp.h"
|
@@ -4989,8 +4990,8 @@ get_actual_variable_range(PlannerInfo *root, VariableStatData *vardata,
|
4989 | 4990 | /* If min is requested ... */
|
4990 | 4991 | if (min)
|
4991 | 4992 | {
|
4992 |
| - index_scan = index_beginscan(heapRel, indexRel, SnapshotNow, |
4993 |
| - 1, 0); |
| 4993 | + index_scan = index_beginscan(heapRel, indexRel, |
| 4994 | + GetActiveSnapshot(), 1, 0); |
4994 | 4995 | index_rescan(index_scan, scankeys, 1, NULL, 0);
|
4995 | 4996 |
|
4996 | 4997 | /* Fetch first tuple in sortop's direction */
|
@@ -5021,8 +5022,8 @@ get_actual_variable_range(PlannerInfo *root, VariableStatData *vardata,
|
5021 | 5022 | /* If max is requested, and we didn't find the index is empty */
|
5022 | 5023 | if (max && have_data)
|
5023 | 5024 | {
|
5024 |
| - index_scan = index_beginscan(heapRel, indexRel, SnapshotNow, |
5025 |
| - 1, 0); |
| 5025 | + index_scan = index_beginscan(heapRel, indexRel, |
| 5026 | + GetActiveSnapshot(), 1, 0); |
5026 | 5027 | index_rescan(index_scan, scankeys, 1, NULL, 0);
|
5027 | 5028 |
|
5028 | 5029 | /* Fetch first tuple in reverse direction */
|
|
0 commit comments