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 个表,所以我将它们合并以获取记录。总数据总计超过3.6亿(3.6 亿),这会影响数据库执行时间和检索记录的能力。有人可以帮助我如何优化它。或任何其他解决方案。