Hi Phil (cc'ed to the list),
as far as I can judge, XQuery expressions are too heterogeneous to provide realistic cost estimations. While our query compiler has some notion of "costs", those values are all relative, and used to select the (presumably) cheapest query plan or index access.
The same applies to the estimation of query results: the costs and size of single XQuery results can vary a lot, as a single result node can span several MB, while a single atomic item may just take a few bytes.
Hope this helps (at least a little), Christian ___________________________
Hi Christian - is there a way to perform a low-cost (very fast) estimation of the amount of time a particular query would take without actually executing the query? In a server environment this is extremely useful. I would like to be able to rapidly check that queries will not be issued which exceed a certain execution time (roughly or even very roughly - e.g. on the order of a second vs. on the order of 100 or 1000 seconds.) Since my queries are going to be dynamically generated based on user supplied parameters this is an issue. A related issue is estimating the number of nodes retrieved as a result of a given query (again without actually executing it.) The estimation would not have to be very exact.