sql - Is there any chance to rearrange the execution plan manually? -
i have 2 tables,
- need
- needcategory
need table has clusted index on needid column, , needcategory have composite clustered index on needid , categoryid.
now take on following query , execution plan query.
select n.needid,n.needname,n.providername dbo.need n join dbo.needcategory nc on nc.needid = n.needid isactive=1 , categoryid= 2 order needname
clustered index scan on need table happens isactive= 1.
clustered index scan on needcategory table happens categoryid=2
my question is,
- why scan happens before join occurs? if happens after join filter lighter. if optimizer chooses scan execute first.
- is there chance rearrange execution plan manually?
thanks in advance
no not lighter after join.
why think lighter after join?
why think better match on nc.needid = n.needid then filter?
if filter first never have match nc.needid = n.needid going eliminated anyway.
that relatively cheap merge join thing.
lets matching socks shoes , want red socks. why match blue sock shoes , eliminate it.
Comments
Post a Comment