On 3/3/21 12:52, Julien Rouhaud wrote:
On Wed, Mar 3, 2021 at 4:57 PM Amit Langote <amitlangot...@gmail.com> wrote:

On Wed, Mar 3, 2021 at 5:52 PM David Rowley <dgrowle...@gmail.com> wrote:
Something like 1 million seems like a more realistic limit to me.
That might still be on the high side, but it'll likely mean we'd not
need to revisit this for quite a while.

+1

Also, I got reminded of this discussion from not so long ago:

https://www.postgresql.org/message-id/flat/16302-e45634e2c0e34e97%40postgresql.org
Thank you

+1

Ok. I changed the value to 1 million and explained this decision in the comment.
This issue caused by two cases:
1. Range partitioning on a timestamp column.
2. Hash partitioning.
Users use range distribution by timestamp because they want to insert new data quickly and analyze entire set of data. Also, in some discussions, I see Oracle users discussing issues with more than 1e5 partitions.

--
regards,
Andrey Lepikhov
Postgres Professional
From a3c1ee9d2e197dee40aed81cb6a08695a8fa2917 Mon Sep 17 00:00:00 2001
From: "Andrey V. Lepikhov" <a.lepik...@postgrespro.ru>
Date: Wed, 3 Mar 2021 11:22:32 +0300
Subject: [PATCH] Increase values of special varnos to 1 million. Use this
 value as a realistic limit for number of range table entries. Restrict it to
 detect possible errors which can cause exceeding of MaxAllocSize in palloc()
 on the elements of the array. This value can be changed later to suit the
 needs of the real world.

---
 src/include/nodes/primnodes.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h
index d4ce037088..06016340a3 100644
--- a/src/include/nodes/primnodes.h
+++ b/src/include/nodes/primnodes.h
@@ -168,9 +168,9 @@ typedef struct Expr
  * in the planner and doesn't correspond to any simple relation column may
  * have varnosyn = varattnosyn = 0.
  */
-#define    INNER_VAR           65000   /* reference to inner subplan */
-#define    OUTER_VAR           65001   /* reference to outer subplan */
-#define    INDEX_VAR           65002   /* reference to index column */
+#define    INNER_VAR           1000000 /* reference to inner subplan */
+#define    OUTER_VAR           1000001 /* reference to outer subplan */
+#define    INDEX_VAR           1000002 /* reference to index column */
 
 #define IS_SPECIAL_VARNO(varno)                ((varno) >= INNER_VAR)
 
-- 
2.29.2

Reply via email to