none
how to build index to improve the performance

    问题

  • Suppose there are two huge tables: a and b.

    How to build index to improve the performance for this query:

    select * from a join b on a.a1= b.b1

    • 已更改类型 SSAS_user 2012年7月6日 11:16 question
    2012年7月6日 11:05

答案

  • With a clustered index on the two column you are joining on, you might get Merge Join rather than a Hash Join for some marginal performance improvement.

    More likely you should take a step back and ask yourself why you are running this query at all, and particularly if you want SELECT *.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    2012年7月6日 11:15