• Z
    Improve select statement with locking clause · 10052f48
    Zhenghua Lyu 提交于
    With GDD enabled, and under some simple cases (refer
    the commit 6ebce733 and the function checkCanOptSelectLockingClause
    for details), we might also do some optimizations for the
    select statement with locking clause and limit clause.
    
    Greenplum generates two-stage-merge sort or limit plan to implement
    sort or limit and we can only lock tuples on segments. We prefer
    locking more tuples on segments rather than locking the whole table.
    Without the whole table lock, performance for OLTP should be improved.
    
    Also, after lockrows data cannot be assumed in order, but we do merge
    gather after lockrows. It is reasonable because even for postgres:
    `select * from t order by c for update` cannot guarantee result's order.
    10052f48
analyze.c 115.1 KB