Re: no partition pruning when partitioning using array type
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>,
Robert Haas <robertmhaas@gmail.com>,
Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2018-07-09T20:53:14Z
Lists: pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> The same occurs in 11 and master. I think this is because the
> polymorphic type is resolved for the function ahead of time (at
> table creation time); partexprs shows
> ({FUNCEXPR :funcid 35757 :funcresulttype 23 :funcretset false :funcvariadic false :funcformat 0 :funccollid 0 :inputcollid 0 :args ({VAR :varno 1 :varattno 1 :vartype 23 :vartypmod -1 :varcollid 0 :varlevelsup 0 :varnoold 1 :varoattno 1 :location 46}) :location 44})
> where the ":funcresulttype 23" bit indicates that the function is
> returning type integer, which I find a bit odd. I think if we were to
> leave it as funcresulttype anynonarray, pruning would work.
... at the cost of breaking many other things.
regards, tom lane
Commits
-
Better handle pseudotypes as partition keys
- b6e3a3a492db 12.0 landed
- e7df94f317c9 11.0 landed
- 7c644b7d3f83 10.5 landed