public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH 06/10] Default to LZ4..
4+ messages / 3 participants
[nested] [flat]

* [PATCH 06/10] Default to LZ4..
@ 2021-03-12 21:35 Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Justin Pryzby @ 2021-03-12 21:35 UTC (permalink / raw)

this is meant to exercise in the CIs, and not meant to be merged
---
 configure                         | 6 ++++--
 configure.ac                      | 4 ++--
 src/backend/access/transam/xlog.c | 2 +-
 src/backend/utils/misc/guc.c      | 2 +-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 9b590eb432..3afa1e87e3 100755
--- a/configure
+++ b/configure
@@ -1575,7 +1575,7 @@ Optional Packages:
   --with-system-tzdata=DIR
                           use system time zone data in DIR
   --without-zlib          do not use Zlib
-  --with-lz4              build with LZ4 support
+  --without-lz4           build without LZ4 support
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-ssl=LIB          use LIB for SSL/TLS support (openssl)
   --with-openssl          obsolete spelling of --with-ssl=openssl
@@ -8598,7 +8598,9 @@ $as_echo "#define USE_LZ4 1" >>confdefs.h
   esac
 
 else
-  with_lz4=no
+  with_lz4=yes
+
+$as_echo "#define USE_LZ4 1" >>confdefs.h
 
 fi
 
diff --git a/configure.ac b/configure.ac
index 2b3b5676eb..d62ea5f742 100644
--- a/configure.ac
+++ b/configure.ac
@@ -990,8 +990,8 @@ AC_SUBST(with_zlib)
 # LZ4
 #
 AC_MSG_CHECKING([whether to build with LZ4 support])
-PGAC_ARG_BOOL(with, lz4, no, [build with LZ4 support],
-              [AC_DEFINE([USE_LZ4], 1, [Define to 1 to build with LZ4 support. (--with-lz4)])])
+PGAC_ARG_BOOL(with, lz4, yes, [build without LZ4 support],
+              [AC_DEFINE([USE_LZ4], 1, [Define to 1 to build without LZ4 support. (--without-lz4)])])
 AC_MSG_RESULT([$with_lz4])
 AC_SUBST(with_lz4)
 
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index f33355e44a..609d954a3a 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -99,7 +99,7 @@ bool		EnableHotStandby = false;
 bool		fullPageWrites = true;
 bool		wal_log_hints = false;
 bool		wal_compression = false;
-int			wal_compression_method = WAL_COMPRESSION_ZLIB;
+int			wal_compression_method = WAL_COMPRESSION_LZ4;
 char	   *wal_consistency_checking_string = NULL;
 bool	   *wal_consistency_checking = NULL;
 bool		wal_init_zero = true;
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index c37a8313d3..52f9cd0242 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -4728,7 +4728,7 @@ static struct config_enum ConfigureNamesEnum[] =
 			NULL
 		},
 		&wal_compression_method,
-		WAL_COMPRESSION_ZLIB, wal_compression_options,
+		WAL_COMPRESSION_LZ4, wal_compression_options,
 		NULL, NULL, NULL
 	},
 
-- 
2.17.0


--0qVF/w3MHQqLSynd
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0007-add-wal_compression_method-zstd.patch"



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Consolidate ItemPointer to Datum conversion functions
@ 2023-02-06 10:11 Heikki Linnakangas <[email protected]>
  2023-02-09 08:33 ` Re: Consolidate ItemPointer to Datum conversion functions Peter Eisentraut <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Heikki Linnakangas @ 2023-02-06 10:11 UTC (permalink / raw)
  To: Peter Eisentraut <[email protected]>; pgsql-hackers

On 06/02/2023 11:54, Peter Eisentraut wrote:
> Instead of defining the same set of macros several times, define it once
> in an appropriate header file.  In passing, convert to inline functions.

Looks good to me. Did you consider moving PG_GETARG_ITEMPOINTER and 
PG_RETURN_ITEMPOINTER, too? They're only used in tid.c, but for most 
datatypes, we define the PG_GETARG and PG_RETURN macros in the same 
header file as the the Datum conversion functions.

- Heikki







^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Consolidate ItemPointer to Datum conversion functions
  2023-02-06 10:11 Re: Consolidate ItemPointer to Datum conversion functions Heikki Linnakangas <[email protected]>
@ 2023-02-09 08:33 ` Peter Eisentraut <[email protected]>
  2023-02-13 09:26   ` Re: Consolidate ItemPointer to Datum conversion functions Peter Eisentraut <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Peter Eisentraut @ 2023-02-09 08:33 UTC (permalink / raw)
  To: Heikki Linnakangas <[email protected]>; pgsql-hackers

On 06.02.23 11:11, Heikki Linnakangas wrote:
> On 06/02/2023 11:54, Peter Eisentraut wrote:
>> Instead of defining the same set of macros several times, define it once
>> in an appropriate header file.  In passing, convert to inline functions.
> 
> Looks good to me. Did you consider moving PG_GETARG_ITEMPOINTER and 
> PG_RETURN_ITEMPOINTER, too? They're only used in tid.c, but for most 
> datatypes, we define the PG_GETARG and PG_RETURN macros in the same 
> header file as the the Datum conversion functions.

Yeah that makes sense.  Here is an updated patch for that.

From 47b316eb6cfa50412d81fd183a8b54e0a104a685 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Thu, 9 Feb 2023 09:23:20 +0100
Subject: [PATCH v2] Consolidate ItemPointer to Datum conversion functions

Instead of defining the same set of macros several times, define it
once in an appropriate header file.  In passing, convert to inline
functions.

Discussion: https://www.postgresql.org/message-id/flat/844dd4c5-e5a1-3df1-bfaf-d1e1c2a16e45%40enterprisedb.com
---
 contrib/pageinspect/btreefuncs.c |  2 --
 contrib/pageinspect/ginfuncs.c   |  3 ---
 contrib/pageinspect/gistfuncs.c  |  2 --
 src/backend/utils/adt/tid.c      |  5 -----
 src/include/storage/itemptr.h    | 20 ++++++++++++++++++++
 5 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/contrib/pageinspect/btreefuncs.c b/contrib/pageinspect/btreefuncs.c
index e4e5dc3c81..9cdc8e182b 100644
--- a/contrib/pageinspect/btreefuncs.c
+++ b/contrib/pageinspect/btreefuncs.c
@@ -50,8 +50,6 @@ PG_FUNCTION_INFO_V1(bt_multi_page_stats);
 
 #define IS_INDEX(r) ((r)->rd_rel->relkind == RELKIND_INDEX)
 #define IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID)
-#define DatumGetItemPointer(X)	 ((ItemPointer) DatumGetPointer(X))
-#define ItemPointerGetDatum(X)	 PointerGetDatum(X)
 
 /* ------------------------------------------------
  * structure for single btree page statistics
diff --git a/contrib/pageinspect/ginfuncs.c b/contrib/pageinspect/ginfuncs.c
index efaa47e86d..0f846988df 100644
--- a/contrib/pageinspect/ginfuncs.c
+++ b/contrib/pageinspect/ginfuncs.c
@@ -21,9 +21,6 @@
 #include "utils/builtins.h"
 #include "utils/rel.h"
 
-#define DatumGetItemPointer(X)	 ((ItemPointer) DatumGetPointer(X))
-#define ItemPointerGetDatum(X)	 PointerGetDatum(X)
-
 
 PG_FUNCTION_INFO_V1(gin_metapage_info);
 PG_FUNCTION_INFO_V1(gin_page_opaque_info);
diff --git a/contrib/pageinspect/gistfuncs.c b/contrib/pageinspect/gistfuncs.c
index 3a947c82af..100697814d 100644
--- a/contrib/pageinspect/gistfuncs.c
+++ b/contrib/pageinspect/gistfuncs.c
@@ -31,8 +31,6 @@ PG_FUNCTION_INFO_V1(gist_page_items_bytea);
 
 #define IS_GIST(r) ((r)->rd_rel->relam == GIST_AM_OID)
 
-#define ItemPointerGetDatum(X)	 PointerGetDatum(X)
-
 
 Datum
 gist_page_opaque_info(PG_FUNCTION_ARGS)
diff --git a/src/backend/utils/adt/tid.c b/src/backend/utils/adt/tid.c
index 251219a1ef..77fb74ab0c 100644
--- a/src/backend/utils/adt/tid.c
+++ b/src/backend/utils/adt/tid.c
@@ -37,11 +37,6 @@
 #include "utils/varlena.h"
 
 
-#define DatumGetItemPointer(X)	 ((ItemPointer) DatumGetPointer(X))
-#define ItemPointerGetDatum(X)	 PointerGetDatum(X)
-#define PG_GETARG_ITEMPOINTER(n) DatumGetItemPointer(PG_GETARG_DATUM(n))
-#define PG_RETURN_ITEMPOINTER(x) return ItemPointerGetDatum(x)
-
 #define LDELIM			'('
 #define RDELIM			')'
 #define DELIM			','
diff --git a/src/include/storage/itemptr.h b/src/include/storage/itemptr.h
index 354e50e68b..fafefa14cd 100644
--- a/src/include/storage/itemptr.h
+++ b/src/include/storage/itemptr.h
@@ -222,4 +222,24 @@ extern int32 ItemPointerCompare(ItemPointer arg1, ItemPointer arg2);
 extern void ItemPointerInc(ItemPointer pointer);
 extern void ItemPointerDec(ItemPointer pointer);
 
+/* ----------------
+ *		Datum conversion functions
+ * ----------------
+ */
+
+static inline ItemPointer
+DatumGetItemPointer(Datum X)
+{
+	return (ItemPointer) DatumGetPointer(X);
+}
+
+static inline Datum
+ItemPointerGetDatum(const ItemPointerData *X)
+{
+	return PointerGetDatum(X);
+}
+
+#define PG_GETARG_ITEMPOINTER(n) DatumGetItemPointer(PG_GETARG_DATUM(n))
+#define PG_RETURN_ITEMPOINTER(x) return ItemPointerGetDatum(x)
+
 #endif							/* ITEMPTR_H */
-- 
2.39.1



Attachments:

  [text/plain] v2-0001-Consolidate-ItemPointer-to-Datum-conversion-funct.patch (3.6K, ../../[email protected]/2-v2-0001-Consolidate-ItemPointer-to-Datum-conversion-funct.patch)
  download | inline diff:
From 47b316eb6cfa50412d81fd183a8b54e0a104a685 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Thu, 9 Feb 2023 09:23:20 +0100
Subject: [PATCH v2] Consolidate ItemPointer to Datum conversion functions

Instead of defining the same set of macros several times, define it
once in an appropriate header file.  In passing, convert to inline
functions.

Discussion: https://www.postgresql.org/message-id/flat/844dd4c5-e5a1-3df1-bfaf-d1e1c2a16e45%40enterprisedb.com
---
 contrib/pageinspect/btreefuncs.c |  2 --
 contrib/pageinspect/ginfuncs.c   |  3 ---
 contrib/pageinspect/gistfuncs.c  |  2 --
 src/backend/utils/adt/tid.c      |  5 -----
 src/include/storage/itemptr.h    | 20 ++++++++++++++++++++
 5 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/contrib/pageinspect/btreefuncs.c b/contrib/pageinspect/btreefuncs.c
index e4e5dc3c81..9cdc8e182b 100644
--- a/contrib/pageinspect/btreefuncs.c
+++ b/contrib/pageinspect/btreefuncs.c
@@ -50,8 +50,6 @@ PG_FUNCTION_INFO_V1(bt_multi_page_stats);
 
 #define IS_INDEX(r) ((r)->rd_rel->relkind == RELKIND_INDEX)
 #define IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID)
-#define DatumGetItemPointer(X)	 ((ItemPointer) DatumGetPointer(X))
-#define ItemPointerGetDatum(X)	 PointerGetDatum(X)
 
 /* ------------------------------------------------
  * structure for single btree page statistics
diff --git a/contrib/pageinspect/ginfuncs.c b/contrib/pageinspect/ginfuncs.c
index efaa47e86d..0f846988df 100644
--- a/contrib/pageinspect/ginfuncs.c
+++ b/contrib/pageinspect/ginfuncs.c
@@ -21,9 +21,6 @@
 #include "utils/builtins.h"
 #include "utils/rel.h"
 
-#define DatumGetItemPointer(X)	 ((ItemPointer) DatumGetPointer(X))
-#define ItemPointerGetDatum(X)	 PointerGetDatum(X)
-
 
 PG_FUNCTION_INFO_V1(gin_metapage_info);
 PG_FUNCTION_INFO_V1(gin_page_opaque_info);
diff --git a/contrib/pageinspect/gistfuncs.c b/contrib/pageinspect/gistfuncs.c
index 3a947c82af..100697814d 100644
--- a/contrib/pageinspect/gistfuncs.c
+++ b/contrib/pageinspect/gistfuncs.c
@@ -31,8 +31,6 @@ PG_FUNCTION_INFO_V1(gist_page_items_bytea);
 
 #define IS_GIST(r) ((r)->rd_rel->relam == GIST_AM_OID)
 
-#define ItemPointerGetDatum(X)	 PointerGetDatum(X)
-
 
 Datum
 gist_page_opaque_info(PG_FUNCTION_ARGS)
diff --git a/src/backend/utils/adt/tid.c b/src/backend/utils/adt/tid.c
index 251219a1ef..77fb74ab0c 100644
--- a/src/backend/utils/adt/tid.c
+++ b/src/backend/utils/adt/tid.c
@@ -37,11 +37,6 @@
 #include "utils/varlena.h"
 
 
-#define DatumGetItemPointer(X)	 ((ItemPointer) DatumGetPointer(X))
-#define ItemPointerGetDatum(X)	 PointerGetDatum(X)
-#define PG_GETARG_ITEMPOINTER(n) DatumGetItemPointer(PG_GETARG_DATUM(n))
-#define PG_RETURN_ITEMPOINTER(x) return ItemPointerGetDatum(x)
-
 #define LDELIM			'('
 #define RDELIM			')'
 #define DELIM			','
diff --git a/src/include/storage/itemptr.h b/src/include/storage/itemptr.h
index 354e50e68b..fafefa14cd 100644
--- a/src/include/storage/itemptr.h
+++ b/src/include/storage/itemptr.h
@@ -222,4 +222,24 @@ extern int32 ItemPointerCompare(ItemPointer arg1, ItemPointer arg2);
 extern void ItemPointerInc(ItemPointer pointer);
 extern void ItemPointerDec(ItemPointer pointer);
 
+/* ----------------
+ *		Datum conversion functions
+ * ----------------
+ */
+
+static inline ItemPointer
+DatumGetItemPointer(Datum X)
+{
+	return (ItemPointer) DatumGetPointer(X);
+}
+
+static inline Datum
+ItemPointerGetDatum(const ItemPointerData *X)
+{
+	return PointerGetDatum(X);
+}
+
+#define PG_GETARG_ITEMPOINTER(n) DatumGetItemPointer(PG_GETARG_DATUM(n))
+#define PG_RETURN_ITEMPOINTER(x) return ItemPointerGetDatum(x)
+
 #endif							/* ITEMPTR_H */
-- 
2.39.1



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Consolidate ItemPointer to Datum conversion functions
  2023-02-06 10:11 Re: Consolidate ItemPointer to Datum conversion functions Heikki Linnakangas <[email protected]>
  2023-02-09 08:33 ` Re: Consolidate ItemPointer to Datum conversion functions Peter Eisentraut <[email protected]>
@ 2023-02-13 09:26   ` Peter Eisentraut <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Peter Eisentraut @ 2023-02-13 09:26 UTC (permalink / raw)
  To: Heikki Linnakangas <[email protected]>; pgsql-hackers

On 09.02.23 09:33, Peter Eisentraut wrote:
> On 06.02.23 11:11, Heikki Linnakangas wrote:
>> On 06/02/2023 11:54, Peter Eisentraut wrote:
>>> Instead of defining the same set of macros several times, define it once
>>> in an appropriate header file.  In passing, convert to inline functions.
>>
>> Looks good to me. Did you consider moving PG_GETARG_ITEMPOINTER and 
>> PG_RETURN_ITEMPOINTER, too? They're only used in tid.c, but for most 
>> datatypes, we define the PG_GETARG and PG_RETURN macros in the same 
>> header file as the the Datum conversion functions.
> 
> Yeah that makes sense.  Here is an updated patch for that.

committed






^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2023-02-13 09:26 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12 21:35 [PATCH 06/10] Default to LZ4.. Justin Pryzby <[email protected]>
2023-02-06 10:11 Re: Consolidate ItemPointer to Datum conversion functions Heikki Linnakangas <[email protected]>
2023-02-09 08:33 ` Re: Consolidate ItemPointer to Datum conversion functions Peter Eisentraut <[email protected]>
2023-02-13 09:26   ` Re: Consolidate ItemPointer to Datum conversion functions Peter Eisentraut <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox