public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH 6/8] Default to LZ4..
2+ messages / 2 participants
[nested] [flat]

* [PATCH 6/8] Default to LZ4..
@ 2021-03-12 21:35 Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 2+ 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/utils/misc/guc.c | 2 +-
 3 files changed, 7 insertions(+), 5 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/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


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



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

* Reg. evaluation of expression in HashCond
@ 2022-01-25 04:14 Vignesh K <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Vignesh K @ 2022-01-25 04:14 UTC (permalink / raw)
  To: pgsql-hackers

Hi,



      I Recently noted that expressions involved in either side of HashCondition in HashJoin is not being pushed down to foreign scan. This leads to evaluation of the same expression multiple times - (for hashvalue computation from hashkeys, for HashCondition expr evaluation, for Projection). Not sure if intended behavior is to not push down expressions in HashCond. Kindly clarify this case. Have attached sample plan for reference.

 contrib_regression=# explain verbose select x_vec.a*2, y_vec.a*2 as a from x_vec, y_vec where x_vec.a*2 = y_vec.a*2 and x_vec.a*2 != 10;

                                         QUERY PLAN                                         

--------------------------------------------------------------------------------------------

 Hash Join  (cost=2.09..4.40 rows=4 width=12)

   Output: (x_vec.a * 2), (y_vec.a * 2)

   Hash Cond: ((x_vec.a * 2) = (y_vec.a * 2))

   ->  Foreign Scan on public.x_vec  (cost=0.00..2.18 rows=12 width=4)

         Output: x_vec.a, x_vec.b

         Filter: ((x_vec.a * 2) <> 10)

         CStore Dir: /home/test/postgres/datasets11/cstore_fdw/452395/453195

         CStore Table Size: 28 kB

   ->  Hash  (cost=2.04..2.04 rows=4 width=8)

         Output: y_vec.a

         ->  Foreign Scan on public.y_vec  (cost=0.00..2.04 rows=4 width=8)

               Output: y_vec.a

               CStore Dir: /home/test/postgres/datasets11/cstore_fdw/452395/453068

               CStore Table Size: 28 kB

(14 rows)


      Here the same expression is being used in HashCond, Projection. Since its not being pushed down to Scan its being evaluated multiple times for HashValue, HashCond and Projection. 
Have used a simple expression for an example. If the expression is complex, query execution slows down due to this.


The same is also being done even if the expression is used in multiple levels. 
contrib_regression=# explain verbose select * from (select x_vec.a*2 as xa2, y_vec.a*2 as ya2 from x_vec, y_vec where x_vec.a*2 = y_vec.a*2) q1 join a on q1.xa2 = a.a;

                                               QUERY PLAN                                               

--------------------------------------------------------------------------------------------------------

 Hash Join  (cost=4.37..8.51 rows=2 width=28)

   Output: (x_vec.a * 2), (y_vec.a * 2), a.a, a.b

   Hash Cond: (a.a = (x_vec.a * 2))

   ->  Foreign Scan on public.a  (cost=0.00..4.07 rows=7 width=16)

         Output: a.a, a.b

         CStore Dir: /home/test/postgres/datasets11/cstore_fdw/452395/453149

         CStore Table Size: 28 kB

   ->  Hash  (cost=4.32..4.32 rows=4 width=12)

         Output: x_vec.a, y_vec.a

         ->  Hash Join  (cost=2.09..4.32 rows=4 width=12)

               Output: x_vec.a, y_vec.a

               Hash Cond: ((x_vec.a * 2) = (y_vec.a * 2))

               ->  Foreign Scan on public.x_vec  (cost=0.00..2.12 rows=12 width=4)

                     Output: x_vec.a, x_vec.b

                     CStore Dir: /home/test/postgres/datasets11/cstore_fdw/452395/453195

                     CStore Table Size: 28 kB

               ->  Hash  (cost=2.04..2.04 rows=4 width=8)

                     Output: y_vec.a

                     ->  Foreign Scan on public.y_vec  (cost=0.00..2.04 rows=4 width=8)

                           Output: y_vec.a

                           CStore Dir: /home/test/postgres/datasets11/cstore_fdw/452395/453068

                           CStore Table Size: 28 kB

(22 rows)





Thanks and regards,

Vignesh K.

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


end of thread, other threads:[~2022-01-25 04:14 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12 21:35 [PATCH 6/8] Default to LZ4.. Justin Pryzby <[email protected]>
2022-01-25 04:14 Reg. evaluation of expression in HashCond Vignesh K <[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