Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.27.1 sync #956

Merged
merged 155 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
befc302
Fix prove_installcheck to use correct paths when used with PGXS (#16990)
liuxueyang Jan 23, 2024
af90388
Ignore symbol ConfigureNamesInt_gp in base 6.26.1 (#17008)
liuxueyang Jan 23, 2024
2795ae2
Fix query with DynamicBitmap scan crash when QueryFinishPending is true
yanwr1 Jan 25, 2024
bb7be5a
Fix the bug which leading to wrong answer of sql string_agg(orderby) …
rainmaple Jan 30, 2024
28c4516
[6X Backport] gprecoverseg: Fix behaviour of -o flag
Annu149 Jan 30, 2024
675423e
Source gpdemo-env.sh in case of DB exists
Jan 30, 2024
d25a34e
[6X][backport] Fix FTS PROBE process memory leak
yanwr1 Jan 30, 2024
3ed4193
Docs: manual verification of EL 7 to EL 8 impacted data
adam8157 Feb 2, 2024
dd33c46
fix gpload create staging table with wrong distribution key order (#1…
xiaoxiaoHe-E Feb 6, 2024
24a54a7
Fix query hang / fallback if involving CTE of replicated (Backport) (…
THANATOSLAVA Feb 6, 2024
4ac7227
Keep partition child lock until end of select
DevChattopadhyay Feb 2, 2024
b87fb03
Resource queue white-box test for multiple portals
soumyadeep2007 Feb 7, 2024
b784319
Add resource queue test to cover role switches
soumyadeep2007 Feb 7, 2024
40bffd9
Add test to enforce ALTER RESOURCE QUEUE behavior
soumyadeep2007 Feb 7, 2024
6e19bec
Fix a statement leak involving self-deadlocks
soumyadeep2007 Feb 7, 2024
06e3baf
Log queueid and portalid in resource queue logs
soumyadeep2007 Feb 7, 2024
b9b2e98
Tests to cover session termination with resqueues
soumyadeep2007 Feb 7, 2024
a7e9f3b
Fix race between termination and resqueue wakeup
soumyadeep2007 Feb 7, 2024
d30e793
Log queue/portal if ResLockRelease returns false
soumyadeep2007 Feb 7, 2024
140b1e8
Add more verbose logging to ResCheckSelfDeadlock()
soumyadeep2007 Feb 7, 2024
f3387e8
Minor logging improvements to reslock release
soumyadeep2007 Feb 7, 2024
9dd3037
Add debugging help in OwnLatch().
macdice Feb 12, 2024
4a09c19
Change the spinlock primitives to function as compiler barriers.
robertmhaas Sep 9, 2014
3db1d11
Fix thinko in 0709b7ee72e4bc71ad07b7120acd117265ab51d0.
robertmhaas Sep 10, 2014
a5fe7ec
Add missing volatile qualifier.
robertmhaas Sep 11, 2014
f5314eb
Still another typo fix for 0709b7ee72e4bc71ad07b7120acd117265ab51d0.
robertmhaas Oct 3, 2014
19d2712
Add a memory barrier in Own/DisownLatch
soumyadeep2007 Feb 12, 2024
ca934be
Updated help doc in consistent with code (#16896) (#16911)
shrakesh Feb 13, 2024
7064cc9
docs - gpfdist supports multi-threaded compression and data transfer …
Jun 17, 2023
b6142ae
Ignore symbol ConfigureNamesBool_gp for base 6.26.3
khannaekta Feb 16, 2024
97a96f8
Fix broken link (#17092)
mperezfuster Feb 19, 2024
54a7f13
Add multi-thread compression for gpfdist in gpdb6 (#16914)
Hlinbit Feb 20, 2024
8a33784
Add new option --gp_version to pg_config. (#17001)
higuoxing Feb 21, 2024
b987ce8
[6X][Doc] Add an description entry for pg_config --gp_version. (#17106)
higuoxing Feb 22, 2024
2ea5992
DOCS: some plcontainer updates for 6.27.0 (#17111)
VMWareJennyBeth Feb 23, 2024
66ccec7
Prioritize history files when archiving
michaelpq Dec 24, 2018
738c5bc
Improve performance of pgarch_readyXlog() with many status files.
robertmhaas Nov 11, 2021
24dcdff
Fix issues in pgarch's new directory-scanning logic.
tglsfdc Dec 29, 2021
f531a3b
[6X]Add verbose option and improve the GUC check error display (#16924)
z-wenlin Feb 27, 2024
3b0526d
Handle ICProxy addresses during gpexpand (#17009)
interma Feb 27, 2024
02a90ff
[ORCA] Fix SIGSEGV using subquery exists on materialized view
dgkimura Feb 12, 2024
6b7a830
Fix Orca to not generate unnecessary slices for plans with Subplans
chrishajas Feb 13, 2024
c06d16b
Fix join condition lost after pull up sublink to join (#17114)
charliettxx Feb 28, 2024
0b188fc
Introduce GUC `gp_enable_mdqa_shared_scan` for three-stage aggregation
QingMa-gp Feb 23, 2024
bffbc60
6X: Re-support DISTINCT-qualified Window Aggregate in Orca (#17127)
chrishajas Feb 28, 2024
70e1d88
Add GPDB6 to GPDB5 minirepro conversion script
Feb 23, 2024
d8c778d
DOCS: Update plcontainer prerequisites and add section called Configu…
VMWareJennyBeth Mar 3, 2024
1a462fc
Add fault type to perform _exit()
soumyadeep2007 Feb 29, 2024
9fe646c
Ensure that a COPY child never runs atexit callbacks
soumyadeep2007 Feb 29, 2024
749a220
Avoid calling proc_exit() in processes forked by system().
nathan-bossart Oct 17, 2023
b356c27
Check that MyProcPid == getpid() in backend signal handlers.
nathan-bossart Feb 14, 2024
fae2829
Remove obsolete check in SIGTERM handler for the startup process.
nathan-bossart Feb 14, 2024
e3894ab
Prefer use of fork_process for COPY .. PROGRAM
soumyadeep2007 Feb 29, 2024
55d8c21
Cleanup error reporting in COPY children
soumyadeep2007 Feb 29, 2024
189ad1e
Add test to cover child handler protection
soumyadeep2007 Feb 29, 2024
74c7654
Add ignore rule for "terminating connection" log
soumyadeep2007 Feb 29, 2024
c28b461
Add ORCA GUC's for dynamic index/bitmap scan
Feb 9, 2024
f7dc0d0
fix compilation error (#17159)
zhrt123 Mar 6, 2024
708502f
[ORCA] Fix ident to const predicate push down optimization
dgkimura Mar 6, 2024
57fef45
Remove unused buf[MAXPGPATH] variable in mdcreate_ao()
haolinw Feb 27, 2024
1ca5486
Provide overflow safe integer math inline functions.
anarazel Oct 30, 2017
03997ed
Detect integer overflow while computing new array dimensions.
tglsfdc Nov 6, 2023
fb39495
pg_upgrade: add support func to check for views using removed operators
kyeap-vmware Feb 9, 2024
4ea870b
pg_upgrade: add support func to check if view contains removed functions
kyeap-vmware Mar 12, 2024
fd27a8a
CO: Support RLE with Zstandard
soumyadeep2007 Mar 12, 2024
dd71aba
Fix pg_basebackup verbose message
jimmyyih Mar 11, 2024
df167dc
Ignore symbol ConfigureNamesBool_gp for base 6.26.4
jimmyyih Mar 13, 2024
ad89ca8
Docs: add pg_cron reference page for GP 6 (#17160)
mperezfuster Mar 14, 2024
51c6430
pg_upgrade: add support func to check if view contains removed types
kyeap-vmware Mar 12, 2024
dc15cd2
Updated ip4r version (#17202)
mperezfuster Mar 20, 2024
565ffa8
Prevent overwriting of worker in ORCA (#17096)
24nishant Mar 20, 2024
dc6874b
[6X] Fix incorrect behavior of gp_move_orphaned_files
Mar 16, 2024
9e4961d
Check orphaned files functions exclude idle sessions when doing safet…
Mar 19, 2024
974e589
Added support to include datadir in gpsegconf_dump file (#16922) (#17…
shrakesh Mar 21, 2024
5f5a05e
Docs: add guc gp_keep_partition_children_locks (#17094)
mperezfuster Mar 22, 2024
0757891
Docs: document RLE with Zstd (#17198)
mperezfuster Mar 22, 2024
efc50ba
Wording nit (#17243)
VMWareJennyBeth Mar 22, 2024
0d385d0
[6X] Fix wrong result of numeric window sum/avg agg.
dreamedcheng Mar 26, 2024
28f644b
skip pg_description and pg_shdescription tables while running missing…
ravoorsh Mar 22, 2024
bf6f4e0
gpcheckcat enhancement to report tables created using mix distributio…
ravoorsh Mar 13, 2024
7979099
Fix TRUNCATE could remove shared AO hash entry in use by other transa…
haolinw Jan 9, 2024
29a33e0
ignore type change of AORelHashEntryData for base 6.26.4
haolinw Mar 25, 2024
5d3f327
New gpcheckcat test (#17269)
VMWareJennyBeth Mar 28, 2024
47a72cc
Handle Invalid Return Value For Opfamily Mdid. (#17229)
24nishant Mar 29, 2024
f439c52
[6X] Add missing volatile qualifier. (#17287)
higuoxing Apr 2, 2024
835224f
[6X Backport] Added Support for -i flag with differential recovery
Annu149 Apr 2, 2024
d5fc910
Prevent archive recovery from scanning non-existent WAL files.
MasaoFujii Apr 7, 2020
a48e970
Modified XLByteToSeg invocation as per definition
SunilS26 Dec 14, 2023
e85a325
Docs: modified the page migrating gpdb from EL 7 to EL 8 to also incl…
mperezfuster Apr 2, 2024
3d7bdbc
Create INIT_FORK for AO aux relations during TRUNCATE operation
ashwinstar Apr 3, 2024
3162d17
[6X] Default to log_checkpoints=on
soumyadeep2007 Apr 3, 2024
5ea36c2
Docs: log_checkpoints
soumyadeep2007 Mar 24, 2024
482d4e8
Reject substituting extension schemas or owners matching ["$'\].
nmisch Aug 7, 2023
ff5738b
[DOC] Add PyXB-X for DSB Python (#17276)
beeender Apr 4, 2024
65526a8
DOCS: New gpmt option (#17299)
shrakesh Apr 4, 2024
0eb8cd4
GlobalShellExecutor checks the whole output as the termination condition
adam8157 Sep 6, 2022
3027c61
Backport disable track_counts in pg_upgrade view checks
bmdoil Apr 3, 2024
d9fb650
Fix ZSTD for RLE when specified at table level
soumyadeep2007 Apr 11, 2024
6ce2718
Fix token for user id xxx doesn't exist (#17325)
lmzzzzz1 Apr 11, 2024
75c70d8
Fix minor rle test diff with describe command
soumyadeep2007 Apr 16, 2024
669d593
Add warning and guard code for zero-column table.
kainwen Apr 16, 2024
4eed1c7
cdbendpoint: Use correct LWLock macro
soumyadeep2007 Apr 16, 2024
8392911
Retire gp_reject_internal_tcp_connection
soumyadeep2007 Apr 16, 2024
0cc877e
Add hint message for MTU settings when IC reports ERROR 'Failed to se…
z-wenlin Apr 19, 2024
13c4e68
Fix flaky archiving tap test
kaknikhil Apr 18, 2024
5052e52
Fix an obvious memory leak in _bitmap_xlog_insert_bitmapwords(), it
interma Apr 10, 2024
32e3038
Always pfree strings returned by GetDatabasePath
alvherre Apr 25, 2022
b5815b1
pg_upgrade: add func to check if view func with changed signature
divyeshddv Apr 3, 2024
9511739
Disable Orca refcount test on Mac (#17404)
chrishajas Apr 29, 2024
fe2aa2f
fix panic when concurrent update with before row update trigger.
zxuejing Apr 30, 2024
dc8c570
[6X Backport] gprecoverseg: recovery progress logging improvement
Annu149 Apr 30, 2024
15a9320
Fix Orca stream operator<< precision (#11322)
dgkimura Jan 12, 2021
8c1a0ab
Use full precision for statistics values in Orca
chrishajas Apr 22, 2024
d6ffa40
binswap: Ignore tables with RLE+ZSTD compression
soumyadeep2007 May 2, 2024
ad037f5
cdbdisp: Set numResults output variable
soumyadeep2007 May 1, 2024
3a60d77
Report dtx protocol command dispatch errors reliably
soumyadeep2007 May 2, 2024
5e3e0f7
[6X Backport] Fix issue with WAL archiving in standby.
ShirishaRao May 1, 2024
4f2db19
[6X Backport] Stream WAL archiving status from primaries to mirrors
ShirishaRao May 1, 2024
9c40667
Adding docs for wal_sender_archiving_status_interval GUC
ShirishaRao May 1, 2024
b9c0471
gpssh: Retry with TERM env variable set during failures
jnihal Apr 23, 2024
afdf9c7
Fix mdqa bug as groupkey is constant (#17377)
charliettxx May 7, 2024
ab5a612
Avoid replay dtx info in checkpoint for newly expanded segments (#17408)
zxuejing May 7, 2024
ed12f65
Revert "Fix inconsistency between the format of queries_now.dat and t…
red1452 May 27, 2024
a15fe54
Revert "Add more locales to docker image and add tests"
red1452 May 27, 2024
da9d43f
Revert "ADBDEV-3675: trigger: Use junkFilter from relinfo instead of …
red1452 May 27, 2024
4f470db
Revert "Add support for target cols with functional dependency on gro…
red1452 May 27, 2024
0eb79a0
Revert "Keep locks on child partitions until end of SELECT (#928)"
red1452 May 27, 2024
c555762
Revert "On DDL operation keep the lock on partitions until end of tra…
red1452 Jun 3, 2024
67937b0
Revert "Keep partition child lock until end of select"
red1452 May 27, 2024
9fe7eb9
Revert "Make postmaster restart archiver soon after it dies, even dur…
red1452 May 27, 2024
21b806b
Revert "Add archive_mode='always' option."
red1452 May 27, 2024
07c59ef
Revert "ORCA: Improve CTE validation only for affected slice (#550)"
red1452 May 27, 2024
26ac5b7
Revert "Implement default transformation flags for gpfdist (#934)"
red1452 May 27, 2024
91ac95e
Revert "gpexpand: skip expanded/broken tables when redistributing"
red1452 May 27, 2024
c3e4bf3
Revert "Avoid linking AO aux tables to extension (#930)"
red1452 May 27, 2024
5bfe2df
Revert "Fix WAL recycling on standbys depending on archive_mode"
red1452 May 28, 2024
7987c8b
Merge branch '6.27.1-conflicts' into 6.27.1-sync
red1452 Jun 3, 2024
c878e52
Avoid linking AO aux tables to extension (#930)
Apr 15, 2024
2c5fb2e
gpexpand: skip expanded/broken tables when redistributing
Jul 4, 2023
d21d55d
Implement default transformation flags for gpfdist (#934)
Apr 27, 2024
a2d9847
ORCA: Improve CTE validation only for affected slice (#550)
HustonMmmavr Jul 19, 2023
8839855
Add more locales to docker image and add tests
dnskvlnk Mar 8, 2023
867b066
Fix inconsistency between the format of queries_now.dat and the queri…
KnightMurloc Oct 30, 2023
189a618
Fix isolation test output for 4ac7227
DevChattopadhyay Feb 2, 2024
e311910
On DDL operation keep the lock on partitions until end of transaction…
maksm90 Mar 28, 2022
7db5043
Keep locks on child partitions until end of SELECT (#928)
bimboterminator1 Apr 18, 2024
51c36d3
Add support for target cols with functional dependency on grouping on…
whitehawk Mar 26, 2024
8f0bc70
Make PGAC_C_BUILTIN_OP_OVERFLOW link instead of just compiling.
anarazel Dec 13, 2017
803a56b
Try to detect runtime unavailability of __builtin_mul_overflow(int64).
anarazel Dec 16, 2017
645a88b
Try harder to detect unavailability of __builtin_mul_overflow(int64).
tglsfdc Dec 17, 2017
ae46efe
Add datadir path to gpsegconfig_dump at cdb dispatcher test (#962)
red1452 May 30, 2024
979c090
Fix regression test bfv_cte with ORCA (#965)
red1452 May 31, 2024
27f5698
Add archive_mode='always' option.
hlinnaka May 15, 2015
4b818bd
Fix WAL recycling on standbys depending on archive_mode
michaelpq Sep 28, 2018
5c59cd2
Make postmaster restart archiver soon after it dies, even during reco…
MasaoFujii Jun 12, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .abi-check/6.26.1/postgres.symbols.ignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ConfigureNamesBool_gp
ConfigureNamesInt_gp
1 change: 1 addition & 0 deletions .abi-check/6.26.3/postgres.symbols.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ConfigureNamesBool_gp
1 change: 1 addition & 0 deletions .abi-check/6.26.4/postgres.symbols.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ConfigureNamesBool_gp
1 change: 1 addition & 0 deletions .abi-check/6.26.4/postgres.types.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AORelHashEntryData
1 change: 1 addition & 0 deletions .abi-check/6.27.0/postgres.symbols.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ConfigureNamesInt_gp
2 changes: 1 addition & 1 deletion concourse/scripts/builds/GpBuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def run_explain_test_suite(self, dbexists):

source_env_cmd = ''
if dbexists:
source_env_cmd='source {0}/greenplum_path.sh && source ~/.bash_profile '.format(INSTALL_DIR)
source_env_cmd='source {0}/greenplum_path.sh && source ~/.bash_profile && source gpdb_src/gpAux/gpdemo/gpdemo-env.sh'.format(INSTALL_DIR)
else:
source_env_cmd = "source {0}/greenplum_path.sh && source gpdb_src/gpAux/gpdemo/gpdemo-env.sh".format(INSTALL_DIR)
status = self.create_demo_cluster(INSTALL_DIR, True)
Expand Down
28 changes: 28 additions & 0 deletions config/c-compiler.m4
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,34 @@ fi])# PGAC_C_BUILTIN_CONSTANT_P



# PGAC_C_BUILTIN_OP_OVERFLOW
# -------------------------
# Check if the C compiler understands __builtin_$op_overflow(),
# and define HAVE__BUILTIN_OP_OVERFLOW if so.
#
# Check for the most complicated case, 64 bit multiplication, as a
# proxy for all of the operations. To detect the case where the compiler
# knows the function but library support is missing, we must link not just
# compile, and store the results in global variables so the compiler doesn't
# optimize away the call.
AC_DEFUN([PGAC_C_BUILTIN_OP_OVERFLOW],
[AC_CACHE_CHECK(for __builtin_mul_overflow, pgac_cv__builtin_op_overflow,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([
PG_INT64_TYPE a = 1;
PG_INT64_TYPE b = 1;
PG_INT64_TYPE result;
int oflo;
],
[oflo = __builtin_mul_overflow(a, b, &result);])],
[pgac_cv__builtin_op_overflow=yes],
[pgac_cv__builtin_op_overflow=no])])
if test x"$pgac_cv__builtin_op_overflow" = xyes ; then
AC_DEFINE(HAVE__BUILTIN_OP_OVERFLOW, 1,
[Define to 1 if your compiler understands __builtin_$op_overflow.])
fi])# PGAC_C_BUILTIN_OP_OVERFLOW



# PGAC_C_BUILTIN_UNREACHABLE
# --------------------------
# Check if the C compiler understands __builtin_unreachable(),
Expand Down
39 changes: 39 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -17614,6 +17614,45 @@ esac

fi

# has to be down here, rather than with the other builtins, because
# the test uses PG_INT64_TYPE.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_mul_overflow" >&5
$as_echo_n "checking for __builtin_mul_overflow... " >&6; }
if ${pgac_cv__builtin_op_overflow+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

PG_INT64_TYPE a = 1;
PG_INT64_TYPE b = 1;
PG_INT64_TYPE result;
int oflo;

int
main ()
{
oflo = __builtin_mul_overflow(a, b, &result);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
pgac_cv__builtin_op_overflow=yes
else
pgac_cv__builtin_op_overflow=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_op_overflow" >&5
$as_echo "$pgac_cv__builtin_op_overflow" >&6; }
if test x"$pgac_cv__builtin_op_overflow" = xyes ; then

$as_echo "#define HAVE__BUILTIN_OP_OVERFLOW 1" >>confdefs.h

fi

# Check size of void *, size_t (enables tweaks for > 32bit address space)
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
Expand Down
4 changes: 4 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -2351,6 +2351,10 @@ if test $pgac_need_repl_snprintf = yes; then
AC_LIBOBJ(snprintf)
fi

# has to be down here, rather than with the other builtins, because
# the test uses PG_INT64_TYPE.
PGAC_C_BUILTIN_OP_OVERFLOW

# Check size of void *, size_t (enables tweaks for > 32bit address space)
AC_CHECK_SIZEOF([void *])
AC_CHECK_SIZEOF([size_t])
Expand Down
48 changes: 48 additions & 0 deletions contrib/pg_upgrade/greenplum/check_gp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,16 @@ check_views_with_unsupported_lag_lead_function(void)
bool db_used = false;

conn = connectToServer(&old_cluster, active_db->db_name);

/*
* Disabling track_counts results in a large performance improvement of
* several orders of magnitude when walking the views. This is because
* calling try_relation_open to get a handle of the view calls
* pgstat_initstats which has been profiled to be very expensive. For
* our purposes, this is not needed and disabled for performance.
*/
PQclear(executeQueryOrDie(conn, "SET track_counts TO off;"));

res = executeQueryOrDie(conn,
"SELECT ev_class::regclass::text viewname "
"FROM pg_rewrite pgr "
Expand All @@ -1191,6 +1201,7 @@ check_views_with_unsupported_lag_lead_function(void)
" FROM (SELECT DISTINCT oid FROM pg_catalog.pg_proc WHERE (proname, pronamespace) in "
" (('lag', 11), ('lead', 11))AND proargtypes[1]=20)s1);");

PQclear(executeQueryOrDie(conn, "RESET track_counts;"));
ntups = PQntuples(res);

i_viewname = PQfnumber(res, "viewname");
Expand Down Expand Up @@ -1253,6 +1264,15 @@ check_views_with_fabricated_anyarray_casts()
conn = connectToServer(&old_cluster, active_db->db_name);
PQclear(executeQueryOrDie(conn, "SET search_path TO 'public';"));

/*
* Disabling track_counts results in a large performance improvement of
* several orders of magnitude when walking the views. This is because
* calling try_relation_open to get a handle of the view calls
* pgstat_initstats which has been profiled to be very expensive. For
* our purposes, this is not needed and disabled for performance.
*/
PQclear(executeQueryOrDie(conn, "SET track_counts TO off;"));

/* Install check support function */
PQclear(executeQueryOrDie(conn,
"CREATE OR REPLACE FUNCTION "
Expand All @@ -1268,6 +1288,7 @@ check_views_with_fabricated_anyarray_casts()

PQclear(executeQueryOrDie(conn, "DROP FUNCTION view_has_anyarray_casts(OID);"));
PQclear(executeQueryOrDie(conn, "SET search_path to 'pg_catalog';"));
PQclear(executeQueryOrDie(conn, "RESET track_counts;"));

ntups = PQntuples(res);
i_viewname = PQfnumber(res, "badviewname");
Expand Down Expand Up @@ -1330,6 +1351,14 @@ check_views_with_fabricated_unknown_casts()

conn = connectToServer(&old_cluster, active_db->db_name);
PQclear(executeQueryOrDie(conn, "SET search_path TO 'public';"));
/*
* Disabling track_counts results in a large performance improvement of
* several orders of magnitude when walking the views. This is because
* calling try_relation_open to get a handle of the view calls
* pgstat_initstats which has been profiled to be very expensive. For
* our purposes, this is not needed and disabled for performance.
*/
PQclear(executeQueryOrDie(conn, "SET track_counts TO off;"));

/* Install check support function */
PQclear(executeQueryOrDie(conn,
Expand All @@ -1346,6 +1375,7 @@ check_views_with_fabricated_unknown_casts()

PQclear(executeQueryOrDie(conn, "DROP FUNCTION view_has_unknown_casts(OID);"));
PQclear(executeQueryOrDie(conn, "SET search_path to 'pg_catalog';"));
PQclear(executeQueryOrDie(conn, "RESET track_counts;"));

ntups = PQntuples(res);
i_viewname = PQfnumber(res, "badviewname");
Expand Down Expand Up @@ -1415,6 +1445,14 @@ check_views_referencing_deprecated_tables()

conn = connectToServer(&old_cluster, active_db->db_name);
PQclear(executeQueryOrDie(conn, "SET search_path TO 'public';"));
/*
* Disabling track_counts results in a large performance improvement of
* several orders of magnitude when walking the views. This is because
* calling try_relation_open to get a handle of the view calls
* pgstat_initstats which has been profiled to be very expensive. For
* our purposes, this is not needed and disabled for performance.
*/
PQclear(executeQueryOrDie(conn, "SET track_counts TO off;"));

/* Install check support function */
PQclear(executeQueryOrDie(conn,
Expand All @@ -1432,6 +1470,7 @@ check_views_referencing_deprecated_tables()

PQclear(executeQueryOrDie(conn, "DROP FUNCTION view_references_deprecated_tables(OID);"));
PQclear(executeQueryOrDie(conn, "SET search_path to 'pg_catalog';"));
PQclear(executeQueryOrDie(conn, "RESET track_counts;"));

ntups = PQntuples(res);
i_viewname = PQfnumber(res, "badviewname");
Expand Down Expand Up @@ -1502,6 +1541,14 @@ check_views_referencing_deprecated_columns()

conn = connectToServer(&old_cluster, active_db->db_name);
PQclear(executeQueryOrDie(conn, "SET search_path TO 'public';"));
/*
* Disabling track_counts results in a large performance improvement of
* several orders of magnitude when walking the views. This is because
* calling try_relation_open to get a handle of the view calls
* pgstat_initstats which has been profiled to be very expensive. For
* our purposes, this is not needed and disabled for performance.
*/
PQclear(executeQueryOrDie(conn, "SET track_counts TO off;"));

/* Install check support function */
PQclear(executeQueryOrDie(conn,
Expand All @@ -1519,6 +1566,7 @@ check_views_referencing_deprecated_columns()

PQclear(executeQueryOrDie(conn, "DROP FUNCTION view_references_deprecated_columns(OID);"));
PQclear(executeQueryOrDie(conn, "SET search_path to 'pg_catalog';"));
PQclear(executeQueryOrDie(conn, "RESET track_counts;"));

ntups = PQntuples(res);
i_viewname = PQfnumber(res, "badviewname");
Expand Down
Loading
Loading