Increase value of OUTER_VAR
Andrei Lepikhov <a.lepikhov@postgrespro.ru>
From: Andrey Lepikhov <a.lepikhov@postgrespro.ru>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-03-03T08:29:12Z
Lists: pgsql-hackers
Attachments
- 0001-Set-values-of-special-varnos-to-the-upper-bound-of-t.patch (text/plain) patch 0001
Hi,
Playing with a large value of partitions I caught the limit with 65000
table entries in a query plan:
if (IS_SPECIAL_VARNO(list_length(glob->finalrtable)))
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("too many range table entries")));
Postgres works well with so many partitions.
The constants INNER_VAR, OUTER_VAR, INDEX_VAR are used as values of the
variable 'var->varno' of integer type. As I see, they were introduced
with commit 1054097464 authored by Marc G. Fournier, in 1996.
Value 65000 was relevant to the size of the int type at that time.
Maybe we will change these values to INT_MAX? (See the patch in attachment).
--
regards,
Andrey Lepikhov
Postgres Professional
Commits
-
Remove arbitrary 64K-or-so limit on rangetable size.
- e3ec3c00d85b 15.0 landed
-
More cleanups of the include files
- 105409746499 7.1.1 cited