I remove the Assert(!is_sorted), its plan looks like as below after adding below codes:if (presorted_keys > 0 && presorted_keys < list_length(best_path->outersortkeys)) use_incremental_sort = true; QUERY PLAN --------------------------------------------------------------------------------------------- LockRows -> Merge Join Merge Cond: (local_tbl.c1 = ft1.c2) -> Index Scan using local_tbl_pkey on local_tbl -> Sort Sort Key: ft1.c2 -> Foreign Scan Relations: (((ft1) INNER JOIN (ft2)) INNER JOIN (ft4)) INNER JOIN (ft5) -> Merge Join Merge Cond: (ft1.c2 = ft5.c1) -> Sort Sort Key: ft1.c2 -> Merge Join Merge Cond: (ft1.c2 = ft4.c1) -> Sort Sort Key: ft1.c2 -> Merge Join Merge Cond: (ft1.c1 = ft2.c1) -> Sort Sort Key: ft1.c1 -> Foreign Scan on ft1 -> Sort Sort Key: ft2.c1 -> Foreign Scan on ft2 -> Sort Sort Key: ft4.c1 -> Foreign Scan on ft4 -> Sort Sort Key: ft5.c1 -> Foreign Scan on ft5
pgsql-bugs by date:
Соглашаюсь с условиями обработки персональных данных