On 11/02/2020 12:58, Zhenghua Lyu wrote:
> Hi,
>
> I have been working on the related issue before.
> (
https://github.com/greenplum-db/gpdb/issues/8362)
> And in my mind, we should do it the same way as upstream.
> Then we can avoid many issues of deadlock.
Ah, I didn't remember that issue. Yep.
> A very troublesome thing needs to mention:
> 1. Greenplum supports partition table's leaves to be in different
> storage types.
> 2. Greenplum supports GDD to improve TP performance, but AO table
> cannot be updated concurrently, we hold ExclusiveLock on any AO tables
> 3. We should make sure that all partitions are locked by the same
> mode when parsing and planning, and the lock order should always be the
> same.
BTW, partitioning in PostgreSQL is even more flexible than in Greenplum.
A partition can be partitioned further (subpartitioning), but the
subpartition doesn't need to have the same partitioning key as its
siblings. And you can have foreign tables in the partition hierarchy,
different partitions can have different indexes etc. I'm not sure how
deep such assumptions run in Greenplum. I think most of the code that
assumed that will be replaced with upstream code anyway, but ORCA might
need some extra code to either deal with such heterogeneous partitions,
or at least detect them and fall back.
- Heikki