On 2016/04/18 15:33, Ashutosh Bapat wrote: >> For time being, I will leave this as yet unaddressed (I am thinking about >> what is reasonable to do for this also considering Robert's comment). Is >> that OK? >> > > Right now EXPLAIN of select * from t1, where t1 is partitioned table shows > Append > -> Seq Scan on t1 > -> Seq scan on partition 1 > -> seq scan on partition 2 > ... > which shows t1 as well as all the partitions on the same level. Users might > have accepted that for inheritance hierarchy but for partitioning that can > be confusing, esp. when all the error messages and documentation indicate > that t1 is an empty (shell?) table. Instead showing it like > Append for t1 -- (essentially show that this is Append for partitioned > table t1, exact text might vary) > -> Seq scan on partition 1 > -> .... > would be more readable. Similarly if we are going to collapse all the > Append hierarchy, it might get even more confusing. Listing all the > intermediate partitioned tables as Seq Scan on them would be confusing for > the reasons mentioned above, and not listing them might make user wonder > about the reasons for their disappearance. I am not sure what's the > solution their.
Yes, things remain confusing with Append plans for partitioned tables. Note that currently if an internal partition doesn't show up, none of its partitions do (given the way CHECK constraints are generated for each table in the partition tree). >> OK, I will address this in the next version. One question though: should >> foreign table be only allowed to be leaf partitions (ie, no PARTITION BY >> clause in CREATE FOREIGN TABLE ... PARTITION OF)? > > That seems a better way. Otherwise users might wonder whether we keep the > partitions of a foreign table on the foreign server which won't be true. Quite true. Can't assume anything other than what the FDW for a given foreign table lets us assume about what the remote table looks like. Existing FDW API allows to treat a foreign table as nothing other than regular tables at best. > But then we allow foreign tables to have local tables as children in > inheritance, so somebody from that background might find it incompatible. I > think we shouldn't let the connection between partitioning and inheritance > linger longer than necessary. I, too, think quite some about this last sentence. But I have only considered DDL yet. Thanks, Amit -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers