Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
Query Selectivity Computation
Query Selectivity Computation
Rate Topic
Display Mode
Topic Options
Author
Message
gaurangtalwadkar
gaurangtalwadkar
Posted Thursday, May 06, 2010 3:49 AM
Forum Newbie
Group: General Forum Members
Last Login: Monday, May 17, 2010 6:02 AM
Points: 7,
Visits: 23
Hi friends,
I m executing different queries with different parameter values from my application.
How to compute selectivity of a query with particular parameter?
Post #916757
kinzent
kinzent
Posted Thursday, May 06, 2010 3:58 AM
SSC Rookie
Group: General Forum Members
Last Login: Friday, December 21, 2012 1:44 AM
Points: 25,
Visits: 289
gaurangtalwadkar (5/6/2010)
Hi friends,
I m executing different queries with different parameter values from my application.
How to compute selectivity of a query with particular parameter?
distinct_values_count / all_values_count
---------------------------------------
Thorn Bird...
Post #916765
gaurangtalwadkar
gaurangtalwadkar
Posted Thursday, May 06, 2010 4:28 AM
Forum Newbie
Group: General Forum Members
Last Login: Monday, May 17, 2010 6:02 AM
Points: 7,
Visits: 23
I want to know whether der is any in-built function in SQL Server which gives selectivity of the query when the query is executed.
Post #916785
Grant Fritchey
Grant Fritchey
Posted Thursday, May 06, 2010 6:07 AM
SSChampion
Group: General Forum Members
Last Login: Yesterday @ 12:19 PM
Points: 13,371,
Visits: 25,144
A query is not selective or not. The data it is accessing may or may not be selective. I don't understand where you're trying to go with this.
You can query statistics and indexes to determine the selectivity of the underlying data. Is that what you're looking for?
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #916844
gaurangtalwadkar
gaurangtalwadkar
Posted Thursday, May 13, 2010 7:37 AM
Forum Newbie
Group: General Forum Members
Last Login: Monday, May 17, 2010 6:02 AM
Points: 7,
Visits: 23
Hi everybody,
how can I get query selectivity estimation in Sql server?
I m executing query from C# application where I have provide text editor to write sql queries.
Post #921255
Grant Fritchey
Grant Fritchey
Posted Monday, May 17, 2010 5:48 AM
SSChampion
Group: General Forum Members
Last Login: Yesterday @ 12:19 PM
Points: 13,371,
Visits: 25,144
I still don't understand what you're asking for? A query has no selectivity. There is not a measured set of uniquely identifying data about a query. The data stored in tables and indexes have selectivity. You're going to have to better define what it is that you're looking for in order to get a specific answer.
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #922830
Lowell
Lowell
Posted Monday, May 17, 2010 5:56 AM
SSChampion
Group: General Forum Members
Last Login: Yesterday @ 3:24 PM
Points: 11,605,
Visits: 27,649
he had a similar thread on this;
i think the original poster is trying to get a formula like (#records matching my WHERE clause) / Total Records, but he thinks it is stored in the statistics of the server?
That's not the same as the statistics kept in SQL Server, and would vary for every query with a different WHERE statmenet.
Lowell
--
There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #922838
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.