public inbox for [email protected]
help / color / mirror / Atom feed[PATCH v3 3/3] Fix sizing of tape read buffers.
22+ messages / 2 participants
[nested] [flat]
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v3 3/3] Fix sizing of tape read buffers.
@ 2021-01-22 20:59 Heikki Linnakangas <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Heikki Linnakangas @ 2021-01-22 20:59 UTC (permalink / raw)
---
src/backend/utils/sort/tuplesort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 14104643e78..aff2f201f52 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2658,7 +2658,7 @@ merge_read_buffer_size(int64 avail_mem, int nInputTapes, int nInputRuns,
* we derive the input buffer size from the amount of memory available,
* and M and N.
*/
- return (avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes;
+ return Max((avail_mem - TAPE_BUFFER_OVERHEAD * nOutputTapes) / nInputTapes, 0);
}
/*
--
2.29.2
--------------631E0A48DCAEA386819DFCEC--
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: pg_waldump
@ 2023-12-19 15:11 Fabrice Chapuis <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Fabrice Chapuis @ 2023-12-19 15:11 UTC (permalink / raw)
To: Matthias van de Meent <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]>
Ok thanks for all these precisions
Regards
Fabrice
On Tue, Dec 19, 2023 at 2:00 PM Matthias van de Meent <
[email protected]> wrote:
> On Tue, 19 Dec 2023, 12:27 Fabrice Chapuis, <[email protected]>
> wrote:
> >
> > Hi,
> > Is it possible to visualize the DDL with the pg_waldump tool. I created
> a postgres user but I cannot find the creation command in the wals
>
> Not really, no. PostgreSQL does not log DDL or DML as such in WAL.
> Essentially all catalog updates are logged only as changes on a
> certain page in some file: a new user getting inserted would be
> approximately "Insert tuple [user's pg_role row data] on page X in
> file [the file corresponding to the pg_role table]".
>
> You could likely derive most DDL commands from Heap/Insert,
> Heap/Delete, and Heap/Update records (after cross-referencing the
> database's relfilemap), as most DDL is "just" a lot of in-memory
> operations plus some record insertions/updates/deletes in catalog
> tables. You'd also need to keep track of any relfilemap changes while
> processing the WAL, as VACUUM FULL on the catalog tables would change
> the file numbering of catalog tables...
>
> Kind regards,
>
> Matthias van de Meent
> Neon (https://neon.tech)
>
^ permalink raw reply [nested|flat] 22+ messages in thread
end of thread, other threads:[~2023-12-19 15:11 UTC | newest]
Thread overview: 22+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2021-01-22 20:59 [PATCH v3 3/3] Fix sizing of tape read buffers. Heikki Linnakangas <[email protected]>
2023-12-19 15:11 Re: pg_waldump Fabrice Chapuis <[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