Der er ingen forskel overhovedet mellem left
og substring
fordi left
er oversat til substring
i udførelsesplanen.
For eksempel:
select substring(col, 1, 2),
left(col, 3)
from YourTable
vil se sådan ud i udførelsesplanen
<DefinedValue>
<ColumnReference Column="Expr1004" />
<ScalarOperator ScalarString="substring([col],(1),(2))">
<Intrinsic FunctionName="substring">
<ScalarOperator>
<Identifier>
<ColumnReference Column="col" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(2)" />
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1005" />
<ScalarOperator ScalarString="substring([col],(1),(3))">
<Intrinsic FunctionName="substring">
<ScalarOperator>
<Identifier>
<ColumnReference Column="col" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(3)" />
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</DefinedValue>