Frans,
We are about to buy SQL Server Licenses (per processor) for our application and having decided that 4x Standard Edition processor licenses are better than 1x Enterprise Ed processor license we have come up against a problem regarding our use of Indexed Views.
The SQL Server Standard Ed query optimiser doesn't consider Indexed Views by default (unlike the Enterprise Edition). This means that you have to manually specify a NOEXPAND hint for SELECT statements
. See Using Indexed Views On Non Enterprise Editions of SQL Server for details...
SELECT Ark_Item.ItemID, ItemName
FROM Ark_ReadableFolderItem
INNER JOIN Ark_Item ON Ark_Item.ItemID = Ark_ReadableFolderItem.ItemID
WHERE FolderID = 107 AND (GroupID = 74 OR GroupID = 78 )
SELECT Ark_Item.ItemID, ItemName
FROM Ark_ReadableFolderItem WITH (NOEXPAND)
INNER JOIN Ark_Item ON Ark_Item.ItemID = Ark_ReadableFolderItem.ItemID
WHERE FolderID = 107 AND (GroupID = 74 OR GroupID = 78 )
The first query does not consider using the Indexed View "ReadableFolderItem" while the second one does...
Obviously there is a BIG diference in the performance...
A quick search of the docs leads me to believe that the NOEXPAND hint is not currently supported.
I know there is a way to specify a NoLock hint using
SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine.UseNoLockHintOnSelects = true;
and was wondering how big a deal would it be to add NOEXPAND to the DynamicQueryEngine?
[edit]
mmm Having looked at the code, the NoLock hint seems to be global which won't do... There is however a RdbmsHint enum which currently contains on 1 hint type... and is emitted around line 721 of the DynamicQueryEngine
queryText.Append(base.Creator.CreateObjectName(fieldsPersistenceInfo[0]));
if(selectList[0].ObjectAlias!=string.Empty)
{
queryText.AppendFormat(" AS [{0}]", selectList[0].ObjectAlias);
}
queryText.AppendFormat(" {0}", ((IDbSpecificHintCreator)base.Creator).CreateHintStatement(RdbmsHint.TableInFromClauseHint, null));
Would it be as simple as expanding upon this?
Marcus