SELECT party_code , max(date) AS date FROM
server1.table1 WITH (nolock) GROUP BY party_code
UNION
SELECT party_code , max(date) AS date FROM
server2.table1 WITH (nolock) GROUP BY party_code
UNION
SELECT party_code , max(date) AS date FROM
server3.table1 WITH (nolock) GROUP BY party_code
如上所示,我在不同的服务器上有17个类似的表格,因此我将它们合并以获取记录。总数据量超过36 千万(360百万),这会影响数据库执行时间和检索记录的能力。有人能帮我优化吗?或者有其他解决方案。