Dear Dmitry,
Please let me elaborate more about our real need regarding the DocumentUrlPath field.
In our current project a key requirement is to provide the ability to authors to create live (friendly) urls for the content pages that would reflect the structure of the content tree (e.g. the Name Path) and would be totally customizable. Also, the produced urls have to be culture dependent, meaning that the same node/page has to be able to provide a different live url for each supported locale.
In order to fulfill this requirement, we have introduced a string field (named LocalizedUrlPath) in each page type whose page has to be accessible by a url. Also, we have created a module in the Admin application that manages the value of this field. The module is "listening" for a node's Create, Update or Move event and after a url creation and sanitizing process based on the value of the DocumentNamePath, it stores the result in the above field.
In the same context, in our page types we set the "Url Pattern" to /{%ToLower(DocumentCulture)%}{%ToLower(LocalizedUrlPath)%}. In this way the urls produced by our solution have two parts, the first is the culture code (e.g. en-us) and the second part is the "friendly" url.
In order to route this type of urls, we have created a convention-based routing system which routes each page type to a designated controller depending on the page's ClassName (e.g. NodeClassName). In our routing system, we initially take the incoming url and perform a MultiDocumentQuery by using the second part (friendly url) of the incoming url, for any page that has this value stored in the LocalizedUrlPath. Then we use the resulting node's ClassName so as to forward the request to the corresponding controller.
This is the point that we face our biggest problem regarding performance. The generated SQL statement for above query is very slow and does not perform well at all. Imagine that for 25 page types that support access by url, the generated SQL statement is consisting of 25 individual SQL blocks (with two left outer joins each) for each page type and then combine all 25 of these blocks with UNION ALL. Also, such a statement cannot be cached, since at this point, we do not know either the ClassName, the AliasPath or the ID of the resulting node.
I realize by your answer that the DocumentUrlPath is indented for the Portal Engine development model, but my idea was to use this field (since its value is a valid url generated by the Document Name Path) instead of our custom LocalizedUrlPath field.
In this way, first, the management of the field is done automatically by the system and not a custom-made module (that will require support from our side).
Secondly, in the routing process, the MutliDocumentQuery that queries for a node against its DocuemntUrlPath generates a very simple SQL statement targeting the CMS_Document table, which is very performant since DocumentUrlPath is an indexed field, which solves our (big) performance issue.
Also, in this direction, we just need to alter the "Url Pattern" of our page types to something like: :/{%ToLower(DocumentCulture)%}{%ToLower(DocumentUrlPath)%}.
Is such a solution possible in the MVC development model?
Thanks in advance,
George