pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Rotate instead of shifting hash join batch number.
7+ messages / 1 participants
[nested] [flat]

* pgsql: Rotate instead of shifting hash join batch number.
@ 2019-12-24 00:21  Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Thomas Munro @ 2019-12-24 00:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Rotate instead of shifting hash join batch number.

Our algorithm for choosing batch numbers turned out not to work
effectively for multi-billion key inner relations.  We would use
more hash bits than we have, and effectively concentrate all tuples
into a smaller number of batches than we intended.  While ideally
we should switch to wider hashes, for now, change the algorithm to
one that effectively gives up bits from the bucket number when we
don't have enough bits.  That means we'll finish up with longer
bucket chains than would be ideal, but that's better than having
batches that don't fit in work_mem and can't be divided.

Batch-patch to all supported releases.

Author: Thomas Munro
Reviewed-by: Tom Lane, thanks also to Tomas Vondra, Alvaro Herrera, Andres Freund for testing and discussion
Reported-by: James Coleman
Discussion: https://postgr.es/m/16104-dc11ed911f1ab9df%40postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e69d644547785cc9f079650d29118a3688bc5039

Modified Files
--------------
src/backend/executor/nodeHash.c | 13 +++++++++----
src/include/port/pg_bitutils.h  |  9 +++++++++
2 files changed, 18 insertions(+), 4 deletions(-)



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

* pgsql: Rotate instead of shifting hash join batch number.
@ 2019-12-24 00:22  Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Thomas Munro @ 2019-12-24 00:22 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Rotate instead of shifting hash join batch number.

Our algorithm for choosing batch numbers turned out not to work
effectively for multi-billion key inner relations.  We would use
more hash bits than we have, and effectively concentrate all tuples
into a smaller number of batches than we intended.  While ideally
we should switch to wider hashes, for now, change the algorithm to
one that effectively gives up bits from the bucket number when we
don't have enough bits.  That means we'll finish up with longer
bucket chains than would be ideal, but that's better than having
batches that don't fit in work_mem and can't be divided.

Batch-patch to all supported releases.

Author: Thomas Munro
Reviewed-by: Tom Lane, thanks also to Tomas Vondra, Alvaro Herrera, Andres Freund for testing and discussion
Reported-by: James Coleman
Discussion: https://postgr.es/m/16104-dc11ed911f1ab9df%40postgresql.org

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8052aaf521e4885477bd1af100edcf21031e6d11

Modified Files
--------------
src/backend/executor/nodeHash.c | 13 +++++++++----
src/include/port/pg_bitutils.h  |  9 +++++++++
2 files changed, 18 insertions(+), 4 deletions(-)



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

* pgsql: Rotate instead of shifting hash join batch number.
@ 2019-12-24 00:22  Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Thomas Munro @ 2019-12-24 00:22 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Rotate instead of shifting hash join batch number.

Our algorithm for choosing batch numbers turned out not to work
effectively for multi-billion key inner relations.  We would use
more hash bits than we have, and effectively concentrate all tuples
into a smaller number of batches than we intended.  While ideally
we should switch to wider hashes, for now, change the algorithm to
one that effectively gives up bits from the bucket number when we
don't have enough bits.  That means we'll finish up with longer
bucket chains than would be ideal, but that's better than having
batches that don't fit in work_mem and can't be divided.

Batch-patch to all supported releases.

Author: Thomas Munro
Reviewed-by: Tom Lane, thanks also to Tomas Vondra, Alvaro Herrera, Andres Freund for testing and discussion
Reported-by: James Coleman
Discussion: https://postgr.es/m/16104-dc11ed911f1ab9df%40postgresql.org

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9e551a14cb45e1240af4978b44d2b7c1c649482e

Modified Files
--------------
src/backend/executor/nodeHash.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)



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

* pgsql: Rotate instead of shifting hash join batch number.
@ 2019-12-24 00:22  Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Thomas Munro @ 2019-12-24 00:22 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Rotate instead of shifting hash join batch number.

Our algorithm for choosing batch numbers turned out not to work
effectively for multi-billion key inner relations.  We would use
more hash bits than we have, and effectively concentrate all tuples
into a smaller number of batches than we intended.  While ideally
we should switch to wider hashes, for now, change the algorithm to
one that effectively gives up bits from the bucket number when we
don't have enough bits.  That means we'll finish up with longer
bucket chains than would be ideal, but that's better than having
batches that don't fit in work_mem and can't be divided.

Batch-patch to all supported releases.

Author: Thomas Munro
Reviewed-by: Tom Lane, thanks also to Tomas Vondra, Alvaro Herrera, Andres Freund for testing and discussion
Reported-by: James Coleman
Discussion: https://postgr.es/m/16104-dc11ed911f1ab9df%40postgresql.org

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8e89bc6dfd3dbd3637d67ad4391805a6e6b2e4cd

Modified Files
--------------
src/backend/executor/nodeHash.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)



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

* pgsql: Rotate instead of shifting hash join batch number.
@ 2019-12-24 00:22  Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Thomas Munro @ 2019-12-24 00:22 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Rotate instead of shifting hash join batch number.

Our algorithm for choosing batch numbers turned out not to work
effectively for multi-billion key inner relations.  We would use
more hash bits than we have, and effectively concentrate all tuples
into a smaller number of batches than we intended.  While ideally
we should switch to wider hashes, for now, change the algorithm to
one that effectively gives up bits from the bucket number when we
don't have enough bits.  That means we'll finish up with longer
bucket chains than would be ideal, but that's better than having
batches that don't fit in work_mem and can't be divided.

Batch-patch to all supported releases.

Author: Thomas Munro
Reviewed-by: Tom Lane, thanks also to Tomas Vondra, Alvaro Herrera, Andres Freund for testing and discussion
Reported-by: James Coleman
Discussion: https://postgr.es/m/16104-dc11ed911f1ab9df%40postgresql.org

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/15861deb65cdd900ed2608ef2de64f9b915c7baf

Modified Files
--------------
src/backend/executor/nodeHash.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)



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

* pgsql: Rotate instead of shifting hash join batch number.
@ 2019-12-24 00:23  Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Thomas Munro @ 2019-12-24 00:23 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Rotate instead of shifting hash join batch number.

Our algorithm for choosing batch numbers turned out not to work
effectively for multi-billion key inner relations.  We would use
more hash bits than we have, and effectively concentrate all tuples
into a smaller number of batches than we intended.  While ideally
we should switch to wider hashes, for now, change the algorithm to
one that effectively gives up bits from the bucket number when we
don't have enough bits.  That means we'll finish up with longer
bucket chains than would be ideal, but that's better than having
batches that don't fit in work_mem and can't be divided.

Batch-patch to all supported releases.

Author: Thomas Munro
Reviewed-by: Tom Lane, thanks also to Tomas Vondra, Alvaro Herrera, Andres Freund for testing and discussion
Reported-by: James Coleman
Discussion: https://postgr.es/m/16104-dc11ed911f1ab9df%40postgresql.org

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/893eaf0be8be32f1d6ee364d5d9e2dae0d87ebfd

Modified Files
--------------
src/backend/executor/nodeHash.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)



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

* pgsql: Rotate instead of shifting hash join batch number.
@ 2019-12-24 00:23  Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Thomas Munro @ 2019-12-24 00:23 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Rotate instead of shifting hash join batch number.

Our algorithm for choosing batch numbers turned out not to work
effectively for multi-billion key inner relations.  We would use
more hash bits than we have, and effectively concentrate all tuples
into a smaller number of batches than we intended.  While ideally
we should switch to wider hashes, for now, change the algorithm to
one that effectively gives up bits from the bucket number when we
don't have enough bits.  That means we'll finish up with longer
bucket chains than would be ideal, but that's better than having
batches that don't fit in work_mem and can't be divided.

Batch-patch to all supported releases.

Author: Thomas Munro
Reviewed-by: Tom Lane, thanks also to Tomas Vondra, Alvaro Herrera, Andres Freund for testing and discussion
Reported-by: James Coleman
Discussion: https://postgr.es/m/16104-dc11ed911f1ab9df%40postgresql.org

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5c0a132cf1410fb9dea577e6b84b8560bb0f7e03

Modified Files
--------------
src/backend/executor/nodeHash.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)



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


end of thread, other threads:[~2019-12-24 00:23 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-12-24 00:21 pgsql: Rotate instead of shifting hash join batch number. Thomas Munro <tmunro@postgresql.org>
2019-12-24 00:22 pgsql: Rotate instead of shifting hash join batch number. Thomas Munro <tmunro@postgresql.org>
2019-12-24 00:22 pgsql: Rotate instead of shifting hash join batch number. Thomas Munro <tmunro@postgresql.org>
2019-12-24 00:22 pgsql: Rotate instead of shifting hash join batch number. Thomas Munro <tmunro@postgresql.org>
2019-12-24 00:22 pgsql: Rotate instead of shifting hash join batch number. Thomas Munro <tmunro@postgresql.org>
2019-12-24 00:23 pgsql: Rotate instead of shifting hash join batch number. Thomas Munro <tmunro@postgresql.org>
2019-12-24 00:23 pgsql: Rotate instead of shifting hash join batch number. Thomas Munro <tmunro@postgresql.org>

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