pgsql: Fix recently-exposed portability issue in regex optimization.

2024-11-17 Thread Tom Lane
Fix recently-exposed portability issue in regex optimization. fixempties() counts the number of in-arcs in the regex NFA and then allocates an array of that many arc pointers. If the NFA contains no arcs, this amounts to malloc(0) for which some platforms return NULL. The code mistakenly treats t

pgsql: Use pg_memory_is_all_zeros() in PageIsVerifiedExtended()

2024-11-17 Thread Michael Paquier
Use pg_memory_is_all_zeros() in PageIsVerifiedExtended() Relying on pg_memory_is_all_zeros(), which would apply SIMD instructions when dealing with an aligned page, is proving to be at least three times faster than the original size_t-based comparisons when checking if a BLCKSZ page is full of zer

pgsql: Improve some code format in gist.c

2024-11-17 Thread Michael Paquier
Improve some code format in gist.c Author: Tender Wang Discussion: https://postgr.es/m/CAHewXNmD=K7XmsHq=l1syyzzyvwu4oamg9ekssme4orxfyk...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c1c09007e219ae68d1f8428a54baf68ccc1f8683 Modified Files --

pgsql: Fix recently-exposed portability issue in regex optimization.

2024-11-17 Thread Tom Lane
Fix recently-exposed portability issue in regex optimization. fixempties() counts the number of in-arcs in the regex NFA and then allocates an array of that many arc pointers. If the NFA contains no arcs, this amounts to malloc(0) for which some platforms return NULL. The code mistakenly treats t

pgsql: Optimize pg_memory_is_all_zeros() in memutils.h

2024-11-17 Thread Michael Paquier
Optimize pg_memory_is_all_zeros() in memutils.h pg_memory_is_all_zeros() is currently implemented to do only a byte-per-byte comparison. While being sufficient for its existing callers for pgstats entries, it could lead to performance regressions should it be used for larger memory areas, like 8k

pgsql: Release notes for 17.2, 16.6, 15.10, 14.15, 13.18, 12.22.

2024-11-17 Thread Tom Lane
Release notes for 17.2, 16.6, 15.10, 14.15, 13.18, 12.22. Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdiff/9ac1003320fd34f7f3f89443213b714d42cc9c8e Modified Files -- doc/src/sgml/release-17.sgml | 225 +++ 1 f

pgsql: Fix recently-exposed portability issue in regex optimization.

2024-11-17 Thread Tom Lane
Fix recently-exposed portability issue in regex optimization. fixempties() counts the number of in-arcs in the regex NFA and then allocates an array of that many arc pointers. If the NFA contains no arcs, this amounts to malloc(0) for which some platforms return NULL. The code mistakenly treats t