In an attempt to improve scalability of a 3.1a site, I have been running SQL Profiler to see which queries are taking the longest.
I find many instances of queries similar to:
(SELECT * FROM View_PageInfo WHERE ((NodeSiteID = 1) AND (DocumentUrlPath = N'/pagepath') AND (DocumentUrlPath <> NodeAliasPath)))
(SELECT * FROM View_PageInfo WHERE ((NodeSiteID = 1) AND (NodeAliasPath = N'/pagepath') AND (DocumentCulture = N'en-US')))
When I display the estimated execution plan for this query, I see that the first part of the union contains most of the query execution time. However, when I run it by itself I notice that it'll never return any records. Further, I don't see any records in my database that will ever return for this query. (Only one record in my database has a DocumentUrlPath set, the root /, and it is equal to NodeAliasPath).
Is this related to a feature we're not using? Is it possible to turn off that part of the query (which is generated by Kentico, as far as I know)?