1
postgres_fdw性能慢
以下针对外部对象的查询大约需要5秒钟才能在320万行上执行: SELECT x."IncidentTypeCode", COUNT(x."IncidentTypeCode") FROM "IntterraNearRealTimeUnitReflexes300sForeign" x WHERE x."IncidentDateTime" >= '05/01/2016' GROUP BY x."IncidentTypeCode" ORDER BY 1; 当我在普通表上执行相同的查询时,它将在0.6秒内返回。执行计划完全不同: 普通表 Sort (cost=226861.20..226861.21 rows=4 width=4) (actual time=646.447..646.448 rows=7 loops=1) Sort Key: "IncidentTypeCode" Sort Method: quicksort Memory: 25kB -> HashAggregate (cost=226861.12..226861.16 rows=4 width=4) (actual time=646.433..646.434 rows=7 loops=1) Group Key: "IncidentTypeCode" -> Bitmap Heap …