gpt4 book ai didi

sql - 索引查询不够优化

转载 作者:行者123 更新时间:2023-12-01 14:41:41 25 4
gpt4 key购买 nike

我正在尝试优化以下查询,但只能用时 10 秒。我试图在连接中涉及的外键表列上应用非聚集索引。有人可以让我知道我可以做些什么来加快查询速度吗?

select
c.companyId,
c.companyName,
c.city,
cst.companyStatusTypeName,
ct.companyTypeName,
sc.simpleIndustryDescription,
c.officeFaxValue,
c.officePhoneValue,
c.streetAddress,
c.streetAddress2,
c.yearFounded,
c.zipCode,
c.webpage,
rep.templateTypeName,
rcg.isoCountry2,
rs.abbreviation
from ciqCompany c
inner join ciqCompanyStatusType cst on cst.companystatustypeid = c.companystatustypeid
inner join ciqCompanyType ct on ct.companyTypeId = c.companyTypeId
inner join refReportingTemplateType rep on rep.templateTypeId = c.reportingtemplateTypeId
inner join refCountryGeo rcg on c.countryId = rcg.countryId
inner join refState rs on rs.stateId = c.stateId
inner join ciqSimpleIndustry sc on sc.simpleIndustryId = c.simpleIndustryId

执行计划

enter image description here

表定义

enter image description here

最佳答案

关于sql - 索引查询不够优化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46491589/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com