Hi, all
I am writing a midware for some heterogeneous data sources, and I need to do some cost estimation to some SQL queries before they are sent to an underlying SQL server.
My question is, is it possible to get the cost estimates of queries from SQL server by some API ? If not, can I get the numbers of distinct values for attributes from the system catalogs ? and how about other statistics, such as cardinality, selectivity?
Thanks a lot!Use QUERY EXECUTION PLAN from Query analyzer and also PROFILER to assess the query process time and indexes.|||Originally posted by Satya
Use QUERY EXECUTION PLAN from Query analyzer
Yes, I can see the execution plan graphiclly displayed in Query analyzer.
But is there a way to use that information in my application?
BTW, what is PROFILER?|||use:
set showplan_all on
it will return what I think you're looking for, in table-based format, which you can iterate through and do what you wish with.|||Thanks strader.
PROFILER is tool used to trace the events on SQL Server, which is best used to know slow running queries and process.
Refer to books online for more information.|||Originally posted by Satya
Thanks strader.
PROFILER is tool used to trace the events on SQL Server, which is best used to know slow running queries and process.
Refer to books online for more information.
Thanks a lot!
No comments:
Post a Comment