wsdl2java failes for Exchange 2010 Autodiscover WebService - axis2

I want to create WebService client classes for using Autodiscover WebService at Exchange 2010.
I'm very happy if someone can help me!!!!
I use the following command:
wsdl2java -d xmlbeans -uri Services.wsdl -o client -u -sn ExchangeAutodiscoverService -pn ExchangeAutodiscoverSoapPort
I get the following exceptions:
Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException:
org.apache.axis2.wsdl.codegen.CodeGenerationException: org.apache.ax
is2.wsdl.databinding.UnmatchedTypeException: No type was mapped to the
name GetUserSettingsRequestMessage with namespace
http://schemas.microsoft.com/ exchange/2010/Autodiscover
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:293)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24) Caused by: org.apache.axis2.wsdl.codegen.CodeGenerationException:
org.apache.axis2.wsdl.databinding.UnmatchedTypeException: No type was
mapped to the name GetUserSettingsRequestMessage with namespace
http://schemas.microsoft.com/exchange/2010/Autodiscover
at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.emitStub(AxisServiceBasedMultiLanguageEmitter.java:537)
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:282)
... 2 more
This is Services.wsdl:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://schemas.microsoft.com/exchange/2010/Autodiscover" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" targetNamespace="http://schemas.microsoft.com/exchange/2010/Autodiscover" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xsd:schema targetNamespace="http://schemas.microsoft.com/exchange/2010/Autodiscover/Imports">
<xsd:import namespace="http://schemas.microsoft.com/exchange/2010/Autodiscover" location="messages.xsd" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="GetUserSettingsRequestMessage">
<wsdl:part name="parameters" element="tns:GetUserSettingsRequestMessage" />
</wsdl:message>
<wsdl:message name="GetUserSettingsRequestMessage_Headers">
<wsdl:part name="RequestedServerVersion" element="tns:RequestedServerVersion" />
</wsdl:message>
<wsdl:message name="GetUserSettingsResponseMessage">
<wsdl:part name="parameters" element="tns:GetUserSettingsResponseMessage" />
</wsdl:message>
<wsdl:message name="GetUserSettingsResponseMessage_Headers">
<wsdl:part name="ServerVersionInfo" element="tns:ServerVersionInfo" />
</wsdl:message>
<wsdl:portType name="Autodiscover">
<wsdl:operation name="GetUserSettings">
<wsdl:input wsaw:Action="http://schemas.microsoft.com/exchange/2010/Autodiscover/Autodiscover/GetUserSettings" name="GetUserSettingsRequestMessage" message="tns:GetUserSettingsRequestMessage" />
<wsdl:output wsaw:Action="http://schemas.microsoft.com/exchange/2010/Autodiscover/Autodiscover/GetUserSettingsResponse" name="GetUserSettingsResponseMessage" message="tns:GetUserSettingsResponseMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DefaultBinding_Autodiscover" type="tns:Autodiscover">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetUserSettings">
<soap:operation soapAction="http://schemas.microsoft.com/exchange/2010/Autodiscover/Autodiscover/GetUserSettings" style="document" />
<wsdl:input name="GetUserSettingsRequestMessage">
<soap:header message="tns:GetUserSettingsRequestMessage_Headers" part="RequestedServerVersion" use="literal" />
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="GetUserSettingsResponseMessage">
<soap:header message="tns:GetUserSettingsResponseMessage_Headers" part="ServerVersionInfo" use="literal" />
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ExchangeAutodiscoverService">
<wsdl:port name="ExchangeAutodiscoverSoapPort" binding="tns:DefaultBinding_Autodiscover">
<soap:address location="https://vm-bs-xchg2010/Autodiscover/Autodiscover.svc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
This is the messages.xsd:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://schemas.microsoft.com/exchange/2010/Autodiscover" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/exchange/2010/Autodiscover" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="GetUserSettingsRequestMessage">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Request" nillable="true" type="tns:GetUserSettingsRequest" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="GetUserSettingsRequest">
<xs:complexContent mixed="false">
<xs:extension base="tns:AutodiscoverRequest">
<xs:sequence>
<xs:element name="Users" nillable="true" type="tns:Users" />
<xs:element name="RequestedSettings" nillable="true" type="tns:RequestedSettings" />
<xs:element name="RequestedVersion" nillable="true" type="tns:ExchangeVersion" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="GetUserSettingsRequest" nillable="true" type="tns:GetUserSettingsRequest" />
<xs:complexType name="AutodiscoverRequest">
<xs:sequence />
</xs:complexType>
<xs:element name="AutodiscoverRequest" nillable="true" type="tns:AutodiscoverRequest" />
<xs:complexType name="Users">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="User" nillable="true" type="tns:User" />
</xs:sequence>
</xs:complexType>
<xs:element name="Users" nillable="true" type="tns:Users" />
<xs:complexType name="User">
<xs:sequence>
<xs:element name="Mailbox" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="User" nillable="true" type="tns:User" />
<xs:complexType name="RequestedSettings">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="Setting" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="RequestedSettings" nillable="true" type="tns:RequestedSettings" />
<xs:simpleType name="ExchangeVersion">
<xs:restriction base="xs:string">
<xs:enumeration value="Exchange2010" />
<xs:enumeration value="Exchange2010_SP1" />
<xs:enumeration value="Exchange2010_SP2" />
</xs:restriction>
</xs:simpleType>
<xs:element name="RequestedServerVersion">
<xs:simpleType>
<xs:restriction base="tns:ExchangeVersion" />
</xs:simpleType>
</xs:element>
<xs:element name="GetUserSettingsResponseMessage">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Response" nillable="true" type="tns:GetUserSettingsResponse" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="GetUserSettingsResponse">
<xs:complexContent mixed="false">
<xs:extension base="tns:AutodiscoverResponse">
<xs:sequence>
<xs:element minOccurs="0" name="UserResponses" nillable="true" type="tns:ArrayOfUserResponse" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="GetUserSettingsResponse" nillable="true" type="tns:GetUserSettingsResponse" />
<xs:complexType name="AutodiscoverResponse">
<xs:sequence>
<xs:element minOccurs="0" name="ErrorCode" type="tns:ErrorCode" />
<xs:element minOccurs="0" name="ErrorMessage" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="AutodiscoverResponse" nillable="true" type="tns:AutodiscoverResponse" />
<xs:simpleType name="ErrorCode">
<xs:restriction base="xs:string">
<xs:enumeration value="NoError" />
<xs:enumeration value="RedirectAddress" />
<xs:enumeration value="RedirectUrl" />
<xs:enumeration value="InvalidUser" />
<xs:enumeration value="InvalidRequest" />
<xs:enumeration value="InvalidSetting" />
<xs:enumeration value="SettingIsNotAvailable" />
<xs:enumeration value="ServerBusy" />
<xs:enumeration value="InvalidDomain" />
<xs:enumeration value="NotFederated" />
<xs:enumeration value="InternalServerError" />
</xs:restriction>
</xs:simpleType>
<xs:element name="ErrorCode" nillable="true" type="tns:ErrorCode" />
<xs:complexType name="ArrayOfUserResponse">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="UserResponse" nillable="true" type="tns:UserResponse" />
</xs:sequence>
</xs:complexType>
<xs:element name="ArrayOfUserResponse" nillable="true" type="tns:ArrayOfUserResponse" />
<xs:complexType name="UserResponse">
<xs:complexContent mixed="false">
<xs:extension base="tns:AutodiscoverResponse">
<xs:sequence>
<xs:element minOccurs="0" name="RedirectTarget" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="UserSettingErrors" nillable="true" type="tns:UserSettingErrors" />
<xs:element minOccurs="0" name="UserSettings" nillable="true" type="tns:UserSettings" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="UserResponse" nillable="true" type="tns:UserResponse" />
<xs:complexType name="UserSettingErrors">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="UserSettingError" nillable="true" type="tns:UserSettingError" />
</xs:sequence>
</xs:complexType>
<xs:element name="UserSettingErrors" nillable="true" type="tns:UserSettingErrors" />
<xs:complexType name="UserSettingError">
<xs:sequence>
<xs:element name="ErrorCode" type="tns:ErrorCode" />
<xs:element name="ErrorMessage" nillable="true" type="xs:string" />
<xs:element name="SettingName" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="UserSettingError" nillable="true" type="tns:UserSettingError" />
<xs:complexType name="UserSettings">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="UserSetting" nillable="true" type="tns:UserSetting" />
</xs:sequence>
</xs:complexType>
<xs:element name="UserSettings" nillable="true" type="tns:UserSettings" />
<xs:complexType name="UserSetting">
<xs:sequence>
<xs:element name="Name" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="UserSetting" nillable="true" type="tns:UserSetting" />
<xs:complexType name="ProtocolConnectionCollectionSetting">
<xs:complexContent mixed="false">
<xs:extension base="tns:UserSetting">
<xs:sequence>
<xs:element name="ProtocolConnections" nillable="true" type="tns:ProtocolConnections" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="ProtocolConnectionCollectionSetting" nillable="true" type="tns:ProtocolConnectionCollectionSetting" />
<xs:complexType name="ProtocolConnections">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="ProtocolConnection" nillable="true" type="tns:ProtocolConnection" />
</xs:sequence>
</xs:complexType>
<xs:element name="ProtocolConnections" nillable="true" type="tns:ProtocolConnections" />
<xs:complexType name="ProtocolConnection">
<xs:sequence>
<xs:element name="Hostname" nillable="true" type="xs:string" />
<xs:element name="Port" type="xs:int" />
<xs:element name="EncryptionMethod" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="ProtocolConnection" nillable="true" type="tns:ProtocolConnection" />
<xs:complexType name="StringSetting">
<xs:complexContent mixed="false">
<xs:extension base="tns:UserSetting">
<xs:sequence>
<xs:element minOccurs="0" name="Value" nillable="true" type="xs:string" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="StringSetting" nillable="true" type="tns:StringSetting" />
<xs:complexType name="WebClientUrlCollectionSetting">
<xs:complexContent mixed="false">
<xs:extension base="tns:UserSetting">
<xs:sequence>
<xs:element name="WebClientUrls" nillable="true" type="tns:WebClientUrls" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="WebClientUrlCollectionSetting" nillable="true" type="tns:WebClientUrlCollectionSetting" />
<xs:complexType name="WebClientUrls">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="WebClientUrl" nillable="true" type="tns:WebClientUrl" />
</xs:sequence>
</xs:complexType>
<xs:element name="WebClientUrls" nillable="true" type="tns:WebClientUrls" />
<xs:complexType name="WebClientUrl">
<xs:sequence>
<xs:element name="AuthenticationMethods" nillable="true" type="xs:string" />
<xs:element name="Url" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="WebClientUrl" nillable="true" type="tns:WebClientUrl" />
<xs:complexType name="AlternateMailboxCollectionSetting">
<xs:complexContent mixed="false">
<xs:extension base="tns:UserSetting">
<xs:sequence>
<xs:element name="AlternateMailboxes" nillable="true" type="tns:AlternateMailboxes" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="AlternateMailboxCollectionSetting" nillable="true" type="tns:AlternateMailboxCollectionSetting" />
<xs:complexType name="AlternateMailboxes">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="AlternateMailbox" nillable="true" type="tns:AlternateMailbox" />
</xs:sequence>
</xs:complexType>
<xs:element name="AlternateMailboxes" nillable="true" type="tns:AlternateMailboxes" />
<xs:complexType name="AlternateMailbox">
<xs:sequence>
<xs:element name="Type" nillable="true" type="xs:string" />
<xs:element name="DisplayName" nillable="true" type="xs:string" />
<xs:element name="LegacyDN" nillable="true" type="xs:string" />
<xs:element name="Server" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="AlternateMailbox" nillable="true" type="tns:AlternateMailbox" />
<xs:complexType name="ServerVersionInfo">
<xs:sequence>
<xs:element minOccurs="0" name="MajorVersion" type="xs:int" />
<xs:element minOccurs="0" name="MinorVersion" type="xs:int" />
<xs:element minOccurs="0" name="MajorBuildNumber" type="xs:int" />
<xs:element minOccurs="0" name="MinorBuildNumber" type="xs:int" />
<xs:element minOccurs="0" name="Version" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="ServerVersionInfo" nillable="true" type="tns:ServerVersionInfo" />
<xs:element name="GetDomainSettingsRequestMessage">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Request" nillable="true" type="tns:GetDomainSettingsRequest" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="GetDomainSettingsRequest">
<xs:complexContent mixed="false">
<xs:extension base="tns:AutodiscoverRequest">
<xs:sequence>
<xs:element name="Domains" nillable="true" type="tns:Domains" />
<xs:element name="RequestedSettings" nillable="true" type="tns:RequestedSettings" />
<xs:element name="RequestedVersion" nillable="true" type="tns:ExchangeVersion" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="GetDomainSettingsRequest" nillable="true" type="tns:GetDomainSettingsRequest" />
<xs:complexType name="Domains">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="Domain" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="Domains" nillable="true" type="tns:Domains" />
<xs:element name="GetDomainSettingsResponseMessage">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Response" nillable="true" type="tns:GetDomainSettingsResponse" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="GetDomainSettingsResponse">
<xs:complexContent mixed="false">
<xs:extension base="tns:AutodiscoverResponse">
<xs:sequence>
<xs:element minOccurs="0" name="DomainResponses" nillable="true" type="tns:ArrayOfDomainResponse" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="GetDomainSettingsResponse" nillable="true" type="tns:GetDomainSettingsResponse" />
<xs:complexType name="ArrayOfDomainResponse">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="DomainResponse" nillable="true" type="tns:DomainResponse" />
</xs:sequence>
</xs:complexType>
<xs:element name="ArrayOfDomainResponse" nillable="true" type="tns:ArrayOfDomainResponse" />
<xs:complexType name="DomainResponse">
<xs:complexContent mixed="false">
<xs:extension base="tns:AutodiscoverResponse">
<xs:sequence>
<xs:element minOccurs="0" name="DomainSettingErrors" nillable="true" type="tns:DomainSettingErrors" />
<xs:element minOccurs="0" name="DomainSettings" nillable="true" type="tns:DomainSettings" />
<xs:element minOccurs="0" name="RedirectTarget" nillable="true" type="xs:string" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="DomainResponse" nillable="true" type="tns:DomainResponse" />
<xs:complexType name="DomainSettingErrors">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="DomainSettingError" nillable="true" type="tns:DomainSettingError" />
</xs:sequence>
</xs:complexType>
<xs:element name="DomainSettingErrors" nillable="true" type="tns:DomainSettingErrors" />
<xs:complexType name="DomainSettingError">
<xs:sequence>
<xs:element name="ErrorCode" type="tns:ErrorCode" />
<xs:element name="ErrorMessage" nillable="true" type="xs:string" />
<xs:element name="SettingName" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="DomainSettingError" nillable="true" type="tns:DomainSettingError" />
<xs:complexType name="DomainSettings">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="DomainSetting" nillable="true" type="tns:DomainSetting" />
</xs:sequence>
</xs:complexType>
<xs:element name="DomainSettings" nillable="true" type="tns:DomainSettings" />
<xs:complexType name="DomainSetting">
<xs:sequence>
<xs:element name="Name" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="DomainSetting" nillable="true" type="tns:DomainSetting" />
<xs:complexType name="DomainStringSetting">
<xs:complexContent mixed="false">
<xs:extension base="tns:DomainSetting">
<xs:sequence>
<xs:element minOccurs="0" name="Value" nillable="true" type="xs:string" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="DomainStringSetting" nillable="true" type="tns:DomainStringSetting" />
<xs:element name="GetFederationInformationRequestMessage">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Request" nillable="true" type="tns:GetFederationInformationRequest" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="GetFederationInformationRequest">
<xs:complexContent mixed="false">
<xs:extension base="tns:AutodiscoverRequest">
<xs:sequence>
<xs:element name="Domain" nillable="true" type="xs:string" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="GetFederationInformationRequest" nillable="true" type="tns:GetFederationInformationRequest" />
<xs:element name="GetFederationInformationResponseMessage">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Response" nillable="true" type="tns:GetFederationInformationResponse" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="GetFederationInformationResponse">
<xs:complexContent mixed="false">
<xs:extension base="tns:AutodiscoverResponse">
<xs:sequence>
<xs:element minOccurs="0" name="ApplicationUri" nillable="true" type="xs:anyURI" />
<xs:element minOccurs="0" name="TokenIssuers" nillable="true" type="tns:TokenIssuers" />
<xs:element minOccurs="0" name="Domains" nillable="true" type="tns:Domains" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="TokenIssuers">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="TokenIssuer" nillable="true" type="tns:TokenIssuer" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="TokenIssuer">
<xs:sequence>
<xs:element minOccurs="0" name="Uri" nillable="true" type="xs:anyURI" />
<xs:element minOccurs="0" name="Endpoint" nillable="true" type="xs:anyURI" />
</xs:sequence>
</xs:complexType>
<xs:element name="GetFederationInformationResponse" nillable="true" type="tns:GetFederationInformationResponse" />
<xs:element name="GetOrganizationRelationshipSettingsRequestMessage">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Request" nillable="true" type="tns:GetOrganizationRelationshipSettingsRequest" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="GetOrganizationRelationshipSettingsRequest">
<xs:complexContent mixed="false">
<xs:extension base="tns:AutodiscoverRequest">
<xs:sequence>
<xs:element name="Domains" nillable="true" type="tns:Domains" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="GetOrganizationRelationshipSettingsRequest" nillable="true" type="tns:GetOrganizationRelationshipSettingsRequest" />
<xs:element name="GetOrganizationRelationshipSettingsResponseMessage">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Response" nillable="true" type="tns:GetOrganizationRelationshipSettingsResponse" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="GetOrganizationRelationshipSettingsResponse">
<xs:complexContent mixed="false">
<xs:extension base="tns:AutodiscoverResponse">
<xs:sequence>
<xs:element minOccurs="0" name="OrganizationRelationshipSettingsCollection" nillable="true" type="tns:OrganizationRelationshipSettingsCollection" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="GetOrganizationRelationshipSettingsResponse" nillable="true" type="tns:GetOrganizationRelationshipSettingsResponse" />
<xs:complexType name="OrganizationRelationshipSettingsCollection">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="OrganizationRelationshipSettings" nillable="true" type="tns:OrganizationRelationshipSettings" />
</xs:sequence>
</xs:complexType>
<xs:element name="OrganizationRelationshipSettingsCollection" nillable="true" type="tns:OrganizationRelationshipSettingsCollection" />
<xs:complexType name="OrganizationRelationshipSettings">
<xs:sequence>
<xs:element name="DeliveryReportEnabled" type="xs:boolean" />
<xs:element name="DomainNames" nillable="true" type="tns:Domains" />
<xs:element name="FreeBusyAccessEnabled" type="xs:boolean" />
<xs:element name="FreeBusyAccessLevel" nillable="true" type="xs:string" />
<xs:element name="MailTipsAccessEnabled" type="xs:boolean" />
<xs:element name="MailTipsAccessLevel" nillable="true" type="xs:string" />
<xs:element name="MailboxMoveEnabled" type="xs:boolean" />
<xs:element name="Name" nillable="true" type="xs:string" />
<xs:element name="TargetApplicationUri" nillable="true" type="xs:anyURI" />
<xs:element name="TargetAutodiscoverEpr" nillable="true" type="xs:anyURI" />
<xs:element name="TargetSharingEpr" nillable="true" type="xs:anyURI" />
</xs:sequence>
</xs:complexType>
<xs:element name="OrganizationRelationshipSettings" nillable="true" type="tns:OrganizationRelationshipSettings" />
</xs:schema>

Related

Why isn't a new index used at all, that was inserted by a hint in the query plan?

In short: I created a new index that was recommended by a hint in the query plan. But it isn't used after it is created. Why?
I use the Microsoft SQL Server 14.0.3401.7.
I have a simple query:
SELECT COUNT(*) FROM [viewAS0003_PJ0003] AS _tbl_
The view is defined as
CREATE VIEW [dbo].[viewAS0003_PJ0003] AS
SELECT p.* FROM [tblAS0003_PJ0003] AS p
JOIN [tblAS0003] AS a ON a.[Id]=p.[IdAddress] WHERE p.[IdUserDelete] IS NULL AND a.[IdUserDelete] IS NULL
Indexes are defined as:
CREATE INDEX [idxAS0003_000058] ON [dbo].[tblAS0003] ([IdUserDelete] ASC)
CREATE INDEX [idxAS0003_PJ0003_001002] ON [dbo].[tblAS0003_PJ0003] ([IdAddress] ASC) INCLUDE([IdUserDelete])
CREATE INDEX [idxAS0003_PJ0003_001021] ON [dbo].[tblAS0003_PJ0003] ([IdUserDelete] ASC)
The query plan shows this:
<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.481" Build="14.0.3401.7" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="1" StatementEstRows="1" StatementId="1" StatementOptmLevel="FULL" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="140" StatementSubTreeCost="0.674259" StatementText="SELECT COUNT(*) FROM [viewAS0003_PJ0003] AS _tbl_" StatementType="SELECT" QueryHash="0x6C6609E0F75DADC3" QueryPlanHash="0x3E3661E36DB25D4C" RetrievedFromCache="true" SecurityPolicyApplied="false">
<StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
<QueryPlan DegreeOfParallelism="1" CachedPlanSize="32" CompileTime="11" CompileCPU="11" CompileMemory="584">
<MissingIndexes>
<MissingIndexGroup Impact="34.0898">
<MissingIndex Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003_PJ0003]">
<ColumnGroup Usage="EQUALITY">
<Column Name="[IdUserDelete]" ColumnId="42" />
</ColumnGroup>
<ColumnGroup Usage="INCLUDE">
<Column Name="[IdAddress]" ColumnId="2" />
</ColumnGroup>
</MissingIndex>
</MissingIndexGroup>
</MissingIndexes>
<MemoryGrantInfo SerialRequiredMemory="0" SerialDesiredMemory="0" />
<OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="209715" EstimatedPagesCached="52428" EstimatedAvailableDegreeOfParallelism="2" MaxCompileMemory="2518336" />
<QueryTimeStats CpuTime="54" ElapsedTime="54" />
<RelOp AvgRowSize="11" EstimateCPU="0" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Compute Scalar" NodeId="0" Parallel="false" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="0.674259">
<OutputList>
<ColumnReference Column="Expr1002" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1002" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(int,[Expr1005],0)">
<Convert DataType="int" Style="0" Implicit="true">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1005" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="11" EstimateCPU="0.0176833" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Aggregate" NodeId="1" Parallel="false" PhysicalOp="Stream Aggregate" EstimatedTotalSubtreeCost="0.674259">
<OutputList>
<ColumnReference Column="Expr1005" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="54" ActualCPUms="54" />
</RunTimeInformation>
<StreamAggregate>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1005" />
<ScalarOperator ScalarString="Count(*)">
<Aggregate AggType="countstar" Distinct="false" />
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="9" EstimateCPU="0.230984" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="29471.3" LogicalOp="Inner Join" NodeId="2" Parallel="false" PhysicalOp="Merge Join" EstimatedTotalSubtreeCost="0.656576">
<OutputList />
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="48538" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="50" ActualCPUms="50" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
</RunTimeInformation>
<Merge ManyToMany="false">
<InnerSideJoinColumns>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003_PJ0003]" Alias="[p]" Column="IdAddress" />
</InnerSideJoinColumns>
<OuterSideJoinColumns>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003]" Alias="[a]" Column="Id" />
</OuterSideJoinColumns>
<Residual>
<ScalarOperator ScalarString="[Grutzeck-AGVIP].[dbo].[tblAS0003_PJ0003].[IdAddress] as [p].[IdAddress]=[Grutzeck-AGVIP].[dbo].[tblAS0003].[Id] as [a].[Id]">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003_PJ0003]" Alias="[p]" Column="IdAddress" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003]" Alias="[a]" Column="Id" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Residual>
<RelOp AvgRowSize="11" EstimateCPU="0.0511395" EstimateIO="0.0925812" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="46347.8" EstimatedRowsRead="46347.8" LogicalOp="Index Seek" NodeId="3" Parallel="false" PhysicalOp="Index Seek" EstimatedTotalSubtreeCost="0.143721" TableCardinality="55572">
<OutputList>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003]" Alias="[a]" Column="Id" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="40628" ActualRowsRead="40628" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="12" ActualCPUms="12" ActualScans="1" ActualLogicalReads="103" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
</RunTimeInformation>
<IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003]" Alias="[a]" Column="Id" />
</DefinedValue>
</DefinedValues>
<Object Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003]" Index="[idxAS0003_000058]" Alias="[a]" IndexKind="NonClustered" Storage="RowStore" />
<SeekPredicates>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003]" Alias="[a]" Column="IdUserDelete" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="NULL">
<Const ConstValue="NULL" />
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
</SeekPredicates>
</IndexScan>
</RelOp>
<RelOp AvgRowSize="15" EstimateCPU="0.0656983" EstimateIO="0.187569" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="59574.7" EstimatedRowsRead="59583" LogicalOp="Index Scan" NodeId="4" Parallel="false" PhysicalOp="Index Scan" EstimatedTotalSubtreeCost="0.253268" TableCardinality="59583">
<OutputList>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003_PJ0003]" Alias="[p]" Column="IdAddress" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="59335" ActualRowsRead="59583" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="21" ActualCPUms="20" ActualScans="1" ActualLogicalReads="252" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
</RunTimeInformation>
<IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003_PJ0003]" Alias="[p]" Column="IdAddress" />
</DefinedValue>
</DefinedValues>
<Object Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003_PJ0003]" Index="[idxAS0003_PJ0003_001002]" Alias="[p]" IndexKind="NonClustered" Storage="RowStore" />
<Predicate>
<ScalarOperator ScalarString="[Grutzeck-AGVIP].[dbo].[tblAS0003_PJ0003].[IdUserDelete] as [p].[IdUserDelete] IS NULL">
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003_PJ0003]" Alias="[p]" Column="IdUserDelete" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Predicate>
</IndexScan>
</RelOp>
</Merge>
</RelOp>
</StreamAggregate>
</RelOp>
</ComputeScalar>
</RelOp>
</QueryPlan>
</StmtSimple>
</Statements>
</Batch>
</BatchSequence>
</ShowPlanXML>
Now I create the new required index.
CREATE INDEX idxTest ON [dbo].[tblAS0003_PJ0003] ([IdUserDelete]) INCLUDE ([IdAddress])
After executing:
CHECKPOINT;
GO
DBCC DROPCLEANBUFFERS;
GO
I repeat the query. Now the query plan shows this:
<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.481" Build="14.0.3401.7" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="1" StatementEstRows="1" StatementId="1" StatementOptmLevel="FULL" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="140" StatementSubTreeCost="0.673673" StatementText="SELECT COUNT(*) FROM [viewAS0003_PJ0003] AS _tbl_" StatementType="SELECT" QueryHash="0x6C6609E0F75DADC3" QueryPlanHash="0x3E3661E36DB25D4C" RetrievedFromCache="true" SecurityPolicyApplied="false">
<StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
<QueryPlan DegreeOfParallelism="1" CachedPlanSize="40" CompileTime="16" CompileCPU="13" CompileMemory="584">
<MemoryGrantInfo SerialRequiredMemory="0" SerialDesiredMemory="0" />
<OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="209715" EstimatedPagesCached="52428" EstimatedAvailableDegreeOfParallelism="2" MaxCompileMemory="2467808" />
<WaitStats>
<Wait WaitType="PAGEIOLATCH_SH" WaitTimeMs="2" WaitCount="3" />
<Wait WaitType="SOS_SCHEDULER_YIELD" WaitTimeMs="38" WaitCount="12" />
</WaitStats>
<QueryTimeStats CpuTime="54" ElapsedTime="94" />
<RelOp AvgRowSize="11" EstimateCPU="0" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Compute Scalar" NodeId="0" Parallel="false" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="0.673673">
<OutputList>
<ColumnReference Column="Expr1002" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1002" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(int,[Expr1005],0)">
<Convert DataType="int" Style="0" Implicit="true">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1005" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="11" EstimateCPU="0.0176121" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Aggregate" NodeId="1" Parallel="false" PhysicalOp="Stream Aggregate" EstimatedTotalSubtreeCost="0.673673">
<OutputList>
<ColumnReference Column="Expr1005" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="94" ActualCPUms="54" />
</RunTimeInformation>
<StreamAggregate>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1005" />
<ScalarOperator ScalarString="Count(*)">
<Aggregate AggType="countstar" Distinct="false" />
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="9" EstimateCPU="0.230469" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="29352.7" LogicalOp="Inner Join" NodeId="2" Parallel="false" PhysicalOp="Merge Join" EstimatedTotalSubtreeCost="0.65606">
<OutputList />
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="48538" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="90" ActualCPUms="50" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
</RunTimeInformation>
<Merge ManyToMany="false">
<InnerSideJoinColumns>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003_PJ0003]" Alias="[p]" Column="IdAddress" />
</InnerSideJoinColumns>
<OuterSideJoinColumns>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003]" Alias="[a]" Column="Id" />
</OuterSideJoinColumns>
<Residual>
<ScalarOperator ScalarString="[Grutzeck-AGVIP].[dbo].[tblAS0003_PJ0003].[IdAddress] as [p].[IdAddress]=[Grutzeck-AGVIP].[dbo].[tblAS0003].[Id] as [a].[Id]">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003_PJ0003]" Alias="[p]" Column="IdAddress" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003]" Alias="[a]" Column="Id" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Residual>
<RelOp AvgRowSize="11" EstimateCPU="0.0511395" EstimateIO="0.0925812" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="46347.8" EstimatedRowsRead="46347.8" LogicalOp="Index Seek" NodeId="3" Parallel="false" PhysicalOp="Index Seek" EstimatedTotalSubtreeCost="0.143721" TableCardinality="55572">
<OutputList>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003]" Alias="[a]" Column="Id" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="40628" ActualRowsRead="40628" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="26" ActualCPUms="11" ActualScans="1" ActualLogicalReads="103" ActualPhysicalReads="1" ActualReadAheads="101" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
</RunTimeInformation>
<IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003]" Alias="[a]" Column="Id" />
</DefinedValue>
</DefinedValues>
<Object Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003]" Index="[idxAS0003_000058]" Alias="[a]" IndexKind="NonClustered" Storage="RowStore" />
<SeekPredicates>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003]" Alias="[a]" Column="IdUserDelete" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="NULL">
<Const ConstValue="NULL" />
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
</SeekPredicates>
</IndexScan>
</RelOp>
<RelOp AvgRowSize="15" EstimateCPU="0.0656983" EstimateIO="0.187569" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="59335" EstimatedRowsRead="59583" LogicalOp="Index Scan" NodeId="4" Parallel="false" PhysicalOp="Index Scan" EstimatedTotalSubtreeCost="0.253268" TableCardinality="59583">
<OutputList>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003_PJ0003]" Alias="[p]" Column="IdAddress" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="59335" ActualRowsRead="59583" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" ActualElapsedms="48" ActualCPUms="22" ActualScans="1" ActualLogicalReads="252" ActualPhysicalReads="0" ActualReadAheads="249" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
</RunTimeInformation>
<IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003_PJ0003]" Alias="[p]" Column="IdAddress" />
</DefinedValue>
</DefinedValues>
<Object Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003_PJ0003]" Index="[idxAS0003_PJ0003_001002]" Alias="[p]" IndexKind="NonClustered" Storage="RowStore" />
<Predicate>
<ScalarOperator ScalarString="[Grutzeck-AGVIP].[dbo].[tblAS0003_PJ0003].[IdUserDelete] as [p].[IdUserDelete] IS NULL">
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[Grutzeck-AGVIP]" Schema="[dbo]" Table="[tblAS0003_PJ0003]" Alias="[p]" Column="IdUserDelete" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Predicate>
</IndexScan>
</RelOp>
</Merge>
</RelOp>
</StreamAggregate>
</RelOp>
</ComputeScalar>
</RelOp>
</QueryPlan>
</StmtSimple>
</Statements>
</Batch>
</BatchSequence>
</ShowPlanXML>
As you can see the new index isn't used at all. The execution plan didn't change. Why?

Merge two schema into one schema (as master detail) using biztalk transform

I need transform two schema into one schema as master detail schema. i have passengerId as unique filed. some master schema's records may not has any reference in detail schema so i need a condition that check if passengerId exist in detail schema create new child for master schema in result.
https://www.dropbox.com/s/8xpbqawstu94u85/transform.jpg?dl=0
master schema :
<xs:complexType name="StoredProcedureResultSet0">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="PassengersId" nillable="true" type="xs:long" />
<xs:element minOccurs="0" maxOccurs="1" name="Gender" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="FirstName" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="LastName" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="ClassOfService" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="SSR" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="FFP" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="ChkInStatus" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="BoardingStatus" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="Passenger_Type" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="SeatNo" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="PassengerCountryCode" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="PassengerCountryName" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
detail schema
<xs:complexType name="StoredProcedureResultSet0">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Origin" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="Destination" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="FlightNo" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="FlightDate" nillable="true" type="xs:dateTime" />
<xs:element minOccurs="0" maxOccurs="1" name="PassengersId" nillable="true" type="xs:long" />
<xs:element minOccurs="0" maxOccurs="1" name="Gender" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="FirstName" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="LastName" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="ClassOfService" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="SSR" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="SSRCode" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="ChkInStatus" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="BoardingStatus" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="Passenger_Type" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="SeatNo" nillable="true" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="PassengerCountryCode" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
result
<xs:complexType>
<xs:sequence>
<xs:element name="Origin" type="xs:string" />
<xs:element name="Destination" type="xs:string" />
<xs:element name="FlightNo" type="xs:string" />
<xs:element name="FlightDate" type="xs:dateTime" />
<xs:element name="PassengersId" type="xs:long" />
<xs:element name="Gender" type="xs:string" />
<xs:element name="FirstName" type="xs:string" />
<xs:element name="LastName" type="xs:string" />
<xs:element name="ClassOfService" type="xs:string" />
<xs:element name="SSR" type="xs:string" />
<xs:element name="SSRCode" type="xs:string" />
<xs:element name="ChkInStatus" type="xs:string" />
<xs:element name="BoardingStatus" type="xs:string" />
<xs:element name="Passenger_Type" type="xs:string" />
<xs:element name="SeatNo" type="xs:string" />
<xs:element name="PassengerCountryCode" type="xs:string" />
<xs:element name="ClassOfService" type="xs:string" />
<xs:element name="FFP" nillable="true" type="xs:string" />
<xs:element name="PassengerCountryName" type="xs:string" />
</xs:sequence>

Why select top ... order by indexed column still sort?

I created the following index to cover the select top statement.
-- Column A, B have type of int
create unique index ix_ on T (A, B) with (data_compression = page)
-- tried to create non-unique index too and the execution plan is the same
select top 20 A, B from T order by A, B -- 19 seconds
select top 20 A, B from T -- return result instantly
However, it still take a while (19 seconds on my table which has 50 million rows) and execution plan shows there is still a "Sort"?
The execution plan shows
Select (Cost: 0%) ← Top (Cost: 0%) ← Parallelism (Gather Streams) (Cost: 0%) ← Sort (Top N Sort) Cost: 93% ← Index Scan (NonClustered) [T.ix_] Cost: 7%
Execution Plan
<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.2" Build="12.0.4100.1" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="1" StatementEstRows="20" StatementId="1" StatementOptmLevel="FULL" CardinalityEstimationModelVersion="120" StatementSubTreeCost="552.009" StatementText="select top 20 A A, B B --, checksum(*) cs
from T with (index(ix_))
order by A, B" StatementType="SELECT" QueryHash="0x1531573504856080" QueryPlanHash="0x5D4FED760C34AF43" RetrievedFromCache="true">
<StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
<QueryPlan DegreeOfParallelism="8" MemoryGrant="1024" CachedPlanSize="24" CompileTime="2" CompileCPU="2" CompileMemory="256">
<ThreadStat Branches="1" UsedThreads="8">
<ThreadReservation NodeId="0" ReservedThreads="8" />
</ThreadStat>
<MemoryGrantInfo SerialRequiredMemory="16" SerialDesiredMemory="24" RequiredMemory="896" DesiredMemory="960" RequestedMemory="1024" GrantWaitTime="0" GrantedMemory="1024" MaxUsedMemory="896" />
<OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="768000" EstimatedPagesCached="768000" EstimatedAvailableDegreeOfParallelism="8" />
<RelOp AvgRowSize="15" EstimateCPU="2E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="20" LogicalOp="Top" NodeId="0" Parallel="false" PhysicalOp="Top" EstimatedTotalSubtreeCost="552.009">
<OutputList>
<ColumnReference Database="[DB]" Schema="[dbo]" Table="[T]" Alias="[T]" Column="B" />
<ColumnReference Database="[DB]" Schema="[dbo]" Table="[T]" Alias="[T]" Column="A" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="20" ActualEndOfScans="1" ActualExecutions="1" />
</RunTimeInformation>
<Top RowCount="false" IsPercent="false" WithTies="false">
<TopExpression>
<ScalarOperator ScalarString="(20)">
<Const ConstValue="(20)" />
</ScalarOperator>
</TopExpression>
<RelOp AvgRowSize="15" EstimateCPU="0.0286101" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="20" LogicalOp="Gather Streams" NodeId="1" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="552.009">
<OutputList>
<ColumnReference Database="[DB]" Schema="[dbo]" Table="[T]" Alias="[T]" Column="B" />
<ColumnReference Database="[DB]" Schema="[dbo]" Table="[T]" Alias="[T]" Column="A" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="20" ActualEndOfScans="0" ActualExecutions="1" />
</RunTimeInformation>
<Parallelism>
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[DB]" Schema="[dbo]" Table="[T]" Alias="[T]" Column="A" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[DB]" Schema="[dbo]" Table="[T]" Alias="[T]" Column="B" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="15" EstimateCPU="212.739" EstimateIO="303.269" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="20" LogicalOp="TopN Sort" NodeId="2" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="551.98">
<OutputList>
<ColumnReference Database="[DB]" Schema="[dbo]" Table="[T]" Alias="[T]" Column="B" />
<ColumnReference Database="[DB]" Schema="[dbo]" Table="[T]" Alias="[T]" Column="A" />
</OutputList>
<MemoryFractions Input="1" Output="1" />
<RunTimeInformation>
<RunTimeCountersPerThread Thread="8" ActualRebinds="1" ActualRewinds="0" ActualRows="12" Batches="0" ActualEndOfScans="0" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="3" ActualRebinds="1" ActualRewinds="0" ActualRows="12" Batches="0" ActualEndOfScans="0" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="7" ActualRebinds="1" ActualRewinds="0" ActualRows="12" Batches="0" ActualEndOfScans="0" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="6" ActualRebinds="1" ActualRewinds="0" ActualRows="20" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="5" ActualRebinds="1" ActualRewinds="0" ActualRows="12" Batches="0" ActualEndOfScans="0" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="4" ActualRebinds="1" ActualRewinds="0" ActualRows="12" Batches="0" ActualEndOfScans="0" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="2" ActualRebinds="1" ActualRewinds="0" ActualRows="12" Batches="0" ActualEndOfScans="0" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="1" ActualRebinds="1" ActualRewinds="0" ActualRows="12" Batches="0" ActualEndOfScans="0" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="0" ActualRebinds="0" ActualRewinds="0" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0" />
</RunTimeInformation>
<TopSort Distinct="false" Rows="20">
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[DB]" Schema="[dbo]" Table="[T]" Alias="[T]" Column="A" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[DB]" Schema="[dbo]" Table="[T]" Alias="[T]" Column="B" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="15" EstimateCPU="5.81245" EstimateIO="30.16" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="42226500" LogicalOp="Index Scan" NodeId="3" Parallel="true" Partitioned="true" PhysicalOp="Index Scan" EstimatedTotalSubtreeCost="35.9724" TableCardinality="42226500">
<OutputList>
<ColumnReference Database="[DB]" Schema="[dbo]" Table="[T]" Alias="[T]" Column="B" />
<ColumnReference Database="[DB]" Schema="[dbo]" Table="[T]" Alias="[T]" Column="A" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="8" ActualRows="3993270" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="7" ActualRows="2713924" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="6" ActualRows="8866373" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="5" ActualRows="10625143" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="4" ActualRows="4254726" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="3" ActualRows="3195887" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="2" ActualRows="3626671" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="1" ActualRows="4950538" Batches="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row" />
<RunTimeCountersPerThread Thread="0" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0" />
</RunTimeInformation>
<RunTimePartitionSummary>
<PartitionsAccessed PartitionCount="41">
<PartitionRange Start="1" End="41" />
</PartitionsAccessed>
</RunTimePartitionSummary>
<IndexScan Ordered="false" ForcedIndex="true" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[DB]" Schema="[dbo]" Table="[T]" Alias="[T]" Column="B" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[DB]" Schema="[dbo]" Table="[T]" Alias="[T]" Column="A" />
</DefinedValue>
</DefinedValues>
<Object Database="[DB]" Schema="[dbo]" Table="[T]" Index="[ix_]" Alias="[T]" IndexKind="NonClustered" Storage="RowStore" />
</IndexScan>
</RelOp>
</TopSort>
</RelOp>
</Parallelism>
</RelOp>
</Top>
</RelOp>
</QueryPlan>
</StmtSimple>
</Statements>
</Batch>
</BatchSequence>
</ShowPlanXML>
Your table is partitioned by B.
The index inherits this partitioning scheme unless you specify otherwise. For example with
create unique index ix_ on T (A, B) with (data_compression = page) on [primary]
(In which case it becomes non aligned and prevents some operations such as metadata only switching)
The lowest "A" value might be in any partition.
This isn't optimised very well. You can keep the aligned index and use this rewrite based on the code here
SELECT TOP 20 A, B
FROM sys.partitions AS P
CROSS APPLY ( SELECT TOP 20 A, B
FROM dbo.T
WHERE $PARTITION.YourPartitionFunction(T.B) = P.partition_number
ORDER BY A,B
) AS A
WHERE P.object_id = OBJECT_ID('dbo.T')
AND P.index_id = INDEXPROPERTY( OBJECT_ID('dbo.T'), 'ix_', 'IndexID' )
ORDER BY A,B
It will get the top 20 rows from each of the 41 partitions (without a sort) then just sort the 820 rows that result from that to get the final top 20 (rather than the whole 42 million).

Wix\heat.exe strange output

I have a directory with one file there: Iesi.Collections.dll.
When I run the following command:
heat.exe dir D:\MyDir -cg References -srd -o D:\Product.wxs -nologo -gg -g1 -dr INSTALLFOLDER
I got really strange output. May be it is strange only for me so please explain it to me. Why I get these registry values? I get the same result for any third party dll like MassTransit or RabbitMQ.
Expected output:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLFOLDER" />
</Fragment>
<Fragment>
<ComponentGroup Id="References">
<Component Id="cmpAD8551805C0E384D4FD6CD718C5E8381" Directory="INSTALLFOLDER" Guid="4253B9B4-21E8-40C8-A71A-A8308BD96F3C">
<File Id="fil1300C7FBD2C9D42B5651E43A08F7DA1E" KeyPath="yes" Source="SourceDir\Iesi.Collections.dll" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
Current output:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLFOLDER" />
</Fragment>
<Fragment>
<ComponentGroup Id="References">
<Component Id="cmpAD8551805C0E384D4FD6CD718C5E8381" Directory="INSTALLFOLDER" Guid="4253B9B4-21E8-40C8-A71A-A8308BD96F3C">
<Class Id="{0436B9AC-9C09-3DF4-B3E9-AA70B658FB39}" Context="InprocServer32" Description="Iesi.Collections.ListSet" ThreadingModel="both" ForeignServer="mscoree.dll">
<ProgId Id="Iesi.Collections.ListSet" Description="Iesi.Collections.ListSet" />
</Class>
<Class Id="{09A2D117-B7B7-3905-88A7-AB20EE344B9F}" Context="InprocServer32" Description="Iesi.Collections.HashedSet" ThreadingModel="both" ForeignServer="mscoree.dll">
<ProgId Id="Iesi.Collections.HashedSet" Description="Iesi.Collections.HashedSet" />
</Class>
<Class Id="{6B58196F-44FD-3EE1-BF83-AEBAABE958DA}" Context="InprocServer32" Description="Iesi.Collections.HybridSet" ThreadingModel="both" ForeignServer="mscoree.dll">
<ProgId Id="Iesi.Collections.HybridSet" Description="Iesi.Collections.HybridSet" />
</Class>
<Class Id="{DD9A864F-8AA2-3DF8-880B-6D38E581E44A}" Context="InprocServer32" Description="Iesi.Collections.SortedSet" ThreadingModel="both" ForeignServer="mscoree.dll">
<ProgId Id="Iesi.Collections.SortedSet" Description="Iesi.Collections.SortedSet" />
</Class>
<File Id="fil1300C7FBD2C9D42B5651E43A08F7DA1E" KeyPath="yes" Source="SourceDir\Iesi.Collections.dll" />
<RegistryValue Root="HKCR" Key="CLSID\{0436B9AC-9C09-3DF4-B3E9-AA70B658FB39}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{0436B9AC-9C09-3DF4-B3E9-AA70B658FB39}\InprocServer32\1.0.1.0" Name="Class" Value="Iesi.Collections.ListSet" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{0436B9AC-9C09-3DF4-B3E9-AA70B658FB39}\InprocServer32\1.0.1.0" Name="Assembly" Value="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{0436B9AC-9C09-3DF4-B3E9-AA70B658FB39}\InprocServer32\1.0.1.0" Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{0436B9AC-9C09-3DF4-B3E9-AA70B658FB39}\InprocServer32\1.0.1.0" Name="CodeBase" Value="file:///[#fil1300C7FBD2C9D42B5651E43A08F7DA1E]" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{0436B9AC-9C09-3DF4-B3E9-AA70B658FB39}\InprocServer32" Name="Class" Value="Iesi.Collections.ListSet" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{0436B9AC-9C09-3DF4-B3E9-AA70B658FB39}\InprocServer32" Name="Assembly" Value="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{0436B9AC-9C09-3DF4-B3E9-AA70B658FB39}\InprocServer32" Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{0436B9AC-9C09-3DF4-B3E9-AA70B658FB39}\InprocServer32" Name="CodeBase" Value="file:///[#fil1300C7FBD2C9D42B5651E43A08F7DA1E]" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{09A2D117-B7B7-3905-88A7-AB20EE344B9F}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{09A2D117-B7B7-3905-88A7-AB20EE344B9F}\InprocServer32\1.0.1.0" Name="Class" Value="Iesi.Collections.HashedSet" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{09A2D117-B7B7-3905-88A7-AB20EE344B9F}\InprocServer32\1.0.1.0" Name="Assembly" Value="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{09A2D117-B7B7-3905-88A7-AB20EE344B9F}\InprocServer32\1.0.1.0" Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{09A2D117-B7B7-3905-88A7-AB20EE344B9F}\InprocServer32\1.0.1.0" Name="CodeBase" Value="file:///[#fil1300C7FBD2C9D42B5651E43A08F7DA1E]" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{09A2D117-B7B7-3905-88A7-AB20EE344B9F}\InprocServer32" Name="Class" Value="Iesi.Collections.HashedSet" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{09A2D117-B7B7-3905-88A7-AB20EE344B9F}\InprocServer32" Name="Assembly" Value="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{09A2D117-B7B7-3905-88A7-AB20EE344B9F}\InprocServer32" Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{09A2D117-B7B7-3905-88A7-AB20EE344B9F}\InprocServer32" Name="CodeBase" Value="file:///[#fil1300C7FBD2C9D42B5651E43A08F7DA1E]" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{6B58196F-44FD-3EE1-BF83-AEBAABE958DA}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{6B58196F-44FD-3EE1-BF83-AEBAABE958DA}\InprocServer32\1.0.1.0" Name="Class" Value="Iesi.Collections.HybridSet" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{6B58196F-44FD-3EE1-BF83-AEBAABE958DA}\InprocServer32\1.0.1.0" Name="Assembly" Value="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{6B58196F-44FD-3EE1-BF83-AEBAABE958DA}\InprocServer32\1.0.1.0" Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{6B58196F-44FD-3EE1-BF83-AEBAABE958DA}\InprocServer32\1.0.1.0" Name="CodeBase" Value="file:///[#fil1300C7FBD2C9D42B5651E43A08F7DA1E]" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{6B58196F-44FD-3EE1-BF83-AEBAABE958DA}\InprocServer32" Name="Class" Value="Iesi.Collections.HybridSet" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{6B58196F-44FD-3EE1-BF83-AEBAABE958DA}\InprocServer32" Name="Assembly" Value="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{6B58196F-44FD-3EE1-BF83-AEBAABE958DA}\InprocServer32" Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{6B58196F-44FD-3EE1-BF83-AEBAABE958DA}\InprocServer32" Name="CodeBase" Value="file:///[#fil1300C7FBD2C9D42B5651E43A08F7DA1E]" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DD9A864F-8AA2-3DF8-880B-6D38E581E44A}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DD9A864F-8AA2-3DF8-880B-6D38E581E44A}\InprocServer32\1.0.1.0" Name="Class" Value="Iesi.Collections.SortedSet" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DD9A864F-8AA2-3DF8-880B-6D38E581E44A}\InprocServer32\1.0.1.0" Name="Assembly" Value="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DD9A864F-8AA2-3DF8-880B-6D38E581E44A}\InprocServer32\1.0.1.0" Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DD9A864F-8AA2-3DF8-880B-6D38E581E44A}\InprocServer32\1.0.1.0" Name="CodeBase" Value="file:///[#fil1300C7FBD2C9D42B5651E43A08F7DA1E]" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DD9A864F-8AA2-3DF8-880B-6D38E581E44A}\InprocServer32" Name="Class" Value="Iesi.Collections.SortedSet" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DD9A864F-8AA2-3DF8-880B-6D38E581E44A}\InprocServer32" Name="Assembly" Value="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DD9A864F-8AA2-3DF8-880B-6D38E581E44A}\InprocServer32" Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DD9A864F-8AA2-3DF8-880B-6D38E581E44A}\InprocServer32" Name="CodeBase" Value="file:///[#fil1300C7FBD2C9D42B5651E43A08F7DA1E]" Type="string" Action="write" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
EDIT: Possible duplicate: How to avoid unnecessary tags when use Heat in wix
You should supply heat.exe with -sreg (suppress registry harvesting) and -scom (suppress COM elements harvesting) command line switches. See heat.exe -? for more options.

How to properly index multiple fields for faster results

I have an index that contains ConChainNum, Control, and TransDate, and I just rebuilt the indexes. The table I'm working with has over 100 million records and the following query returns no results:
select * from sbt_pos_sales
where conchainnum = 810 and
control = 852013688 and
transdate = 20120712
Given that I have an index made specifically with the three fields in the where clause, I really expected an almost immediate result, but it took about half a minute to tell me there where no results.
Can someone explain to me why this index doesn't make it any faster than that, and if I can somehow do it differently to make it faster?
Execution Plan:
<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.1.1" Build="10.0.5500.0" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="1" StatementEstRows="20.2265" StatementId="1" StatementOptmLevel="FULL" StatementSubTreeCost="348.687" StatementText="SELECT * FROM [ngdwdb]..[sbt_pos_sales] WHERE [conchainnum]=#1 AND [control]=#2 AND [transdate]=#3" StatementType="SELECT" QueryHash="0x11B117D9A8C6DF58" QueryPlanHash="0xBA3EFC04623601F6">
<StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
<QueryPlan DegreeOfParallelism="8" MemoryGrant="5504" CachedPlanSize="48" CompileTime="95" CompileCPU="4" CompileMemory="368">
<RelOp AvgRowSize="193" EstimateCPU="0.0655713" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7330.87" LogicalOp="Gather Streams" NodeId="1" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="348.686">
<OutputList>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="RowIdent" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="ConChainNum" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="Control" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="TransDate" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="ControlGS" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="UPC_UCP" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="DateSold" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="Price_UCP" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="Store" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="QtySold" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="FileName" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="IssueCode" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="DealerNum" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="0" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
</RunTimeInformation>
<Parallelism>
<RelOp AvgRowSize="193" EstimateCPU="0.00766076" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7330.87" LogicalOp="Inner Join" NodeId="2" Parallel="true" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="348.621">
<OutputList>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="RowIdent" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="ConChainNum" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="Control" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="TransDate" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="ControlGS" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="UPC_UCP" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="DateSold" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="Price_UCP" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="Store" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="QtySold" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="FileName" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="IssueCode" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="DealerNum" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="6" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="2" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="3" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="7" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="5" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="4" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="8" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="1" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="0" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0" />
</RunTimeInformation>
<NestedLoops Optimized="true" WithUnorderedPrefetch="true">
<OuterReferences>
<ColumnReference Column="Bmk1000" />
<ColumnReference Column="Expr1009" />
</OuterReferences>
<RelOp AvgRowSize="58" EstimateCPU="14.9196" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7330.87" LogicalOp="Compute Scalar" NodeId="5" Parallel="true" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="324.579">
<OutputList>
<ColumnReference Column="Bmk1000" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="ConChainNum" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="Control" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="TransDate" />
<ColumnReference Column="Expr1008" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1008" />
<ScalarOperator ScalarString="BmkToPage([Bmk1000])">
<Intrinsic FunctionName="BmkToPage">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Bmk1000" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="58" EstimateCPU="15.196" EstimateIO="294.463" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7330.87" LogicalOp="Index Seek" NodeId="6" Parallel="true" PhysicalOp="Index Seek" EstimatedTotalSubtreeCost="309.659" TableCardinality="107302000">
<OutputList>
<ColumnReference Column="Bmk1000" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="ConChainNum" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="Control" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="TransDate" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="6" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="3" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="2" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="7" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="8" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="5" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="1" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="4" ActualRows="0" ActualEndOfScans="1" ActualExecutions="1" />
<RunTimeCountersPerThread Thread="0" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0" />
</RunTimeInformation>
<IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Bmk1000" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="ConChainNum" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="Control" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="TransDate" />
</DefinedValue>
</DefinedValues>
<Object Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Index="[idxLoad]" IndexKind="NonClustered" />
<SeekPredicates>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="ConChainNum" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="(810)">
<Const ConstValue="(810)" />
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
</SeekPredicates>
<Predicate>
<ScalarOperator ScalarString="CONVERT_IMPLICIT(int,[NGDWDB].[dbo].[SBT_POS_SALES].[Control],0)=(852013688) AND CONVERT_IMPLICIT(int,[NGDWDB].[dbo].[SBT_POS_SALES].[TransDate],0)=(20120712)">
<Logical Operation="AND">
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Convert DataType="int" Style="0" Implicit="true">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="Control" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(852013688)" />
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Convert DataType="int" Style="0" Implicit="true">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="TransDate" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(20120712)" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Predicate>
</IndexScan>
</RelOp>
</ComputeScalar>
</RelOp>
<RelOp AvgRowSize="136" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="7329.87" EstimateRewinds="0" EstimateRows="1" LogicalOp="RID Lookup" NodeId="11" Parallel="true" PhysicalOp="RID Lookup" EstimatedTotalSubtreeCost="24.0341" TableCardinality="107302000">
<OutputList>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="RowIdent" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="ControlGS" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="UPC_UCP" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="DateSold" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="Price_UCP" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="Store" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="QtySold" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="FileName" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="IssueCode" />
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="DealerNum" />
</OutputList>
<RunTimeInformation>
<RunTimeCountersPerThread Thread="6" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0" />
<RunTimeCountersPerThread Thread="2" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0" />
<RunTimeCountersPerThread Thread="3" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0" />
<RunTimeCountersPerThread Thread="7" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0" />
<RunTimeCountersPerThread Thread="5" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0" />
<RunTimeCountersPerThread Thread="4" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0" />
<RunTimeCountersPerThread Thread="8" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0" />
<RunTimeCountersPerThread Thread="1" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0" />
<RunTimeCountersPerThread Thread="0" ActualRows="0" ActualEndOfScans="0" ActualExecutions="0" />
</RunTimeInformation>
<IndexScan Lookup="true" Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="RowIdent" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="ControlGS" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="UPC_UCP" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="DateSold" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="Price_UCP" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="Store" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="QtySold" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="FileName" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="IssueCode" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" Column="DealerNum" />
</DefinedValue>
</DefinedValues>
<Object Database="[NGDWDB]" Schema="[dbo]" Table="[SBT_POS_SALES]" TableReferenceId="-1" IndexKind="Heap" />
<SeekPredicates>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Column="Bmk1000" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[Bmk1000]">
<Identifier>
<ColumnReference Column="Bmk1000" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
</SeekPredicates>
</IndexScan>
</RelOp>
</NestedLoops>
</RelOp>
</Parallelism>
</RelOp>
<ParameterList>
<ColumnReference Column="#3" ParameterCompiledValue="(20120712)" ParameterRuntimeValue="(20120712)" />
<ColumnReference Column="#2" ParameterCompiledValue="(852013688)" ParameterRuntimeValue="(852013688)" />
<ColumnReference Column="#1" ParameterCompiledValue="(810)" ParameterRuntimeValue="(810)" />
</ParameterList>
</QueryPlan>
</StmtSimple>
</Statements>
</Batch>
</BatchSequence>
</ShowPlanXML>
Rather than keep filling up the comments, I'll formalize this as an answer...
Based on your execution plan, I recommend adding a clustered index on the table. It's hard to be 100% sure what's going on, but RID lookups are a problem.
RID lookups are what happens when there's not a clustering key associated with the table. In a nonclustered index, the clustering key gets replicated in the nonclustered index if there is one, speeding up any row access required after the index entries are found. In a heap (a table with a nonclustered index) you don't have that clustering key, so you have to look it up in the heap.
That's why you have an INNER JOIN in the execution plan, even though there's no JOIN in your SQL. Applying clustering to the primary key in the table should eliminate this join, and leave it with a simple index seek.
Although the current plan shows it burning 89% of your time right now, I'll bet that with a clustered index on the table you'll simplify it down to a simple (and much faster) index seek.
EDIT:
Let me amend this after looking at your execution plan XML. Although the clustering key should still help, the real problem is the data types in your indexes. On the index seek I'm showing
CONVERT_IMPLICIT(int,[NGDWDB].[dbo].[SBT_POS_SALES].[Control],0)=(852013688) AND CONVERT_IMPLICIT(int,[NGDWDB].[dbo].[SBT_POS_SALES].[TransDate],0)=(20120712)
, which is telling me that Control and TransDate are not the same data types as you are providing in your query. If you fix this up such that no conversions are required, you will very likely see a huge speedup in the query.