Showing posts with label order. Show all posts
Showing posts with label order. Show all posts

Wednesday, March 21, 2012

Measuring index usage

I'm looking for a way to monitor index usage, over time, on all user tables
in a db, in order to determine which ones are getting hit the most and which
may not be getting used at all.
Any suggestions?
Thanks
--
MGMG-
Check out the article below. I think it will get you moving in the right
direction.
http://www.sqlmag.com/Article/Artic...rver_38789.html
--
Thomas
"MGeles" wrote:

> I'm looking for a way to monitor index usage, over time, on all user table
s
> in a db, in order to determine which ones are getting hit the most and whi
ch
> may not be getting used at all.
> Any suggestions?
> Thanks
> --
> MG|||If you are running SQL Server 2005, you can use the new
sys.dm_db_index_operational_stats management view:
http://msdn2.microsoft.com/en-us/library/ms174281.aspx
Ryan Stonecipher
Microsoft Sql Server Storage Engine, DBCC
This posting is provided "AS IS" with no warranties, and confers no rights.
"MGeles" <michael.geles@.thomson.com> wrote in message
news:06668ED5-FCC7-4D62-9169-1F70E936D43B@.microsoft.com...
> I'm looking for a way to monitor index usage, over time, on all user
> tables
> in a db, in order to determine which ones are getting hit the most and
> which
> may not be getting used at all.
> Any suggestions?
> Thanks
> --
> MG|||On Thu, 27 Apr 2006 12:28:16 -0700, "Ryan Stonecipher [MSFT]"
<ryanston@.microsoft.com> wrote:

>If you are running SQL Server 2005, you can use the new
>sys.dm_db_index_operational_stats management view:
>http://msdn2.microsoft.com/en-us/library/ms174281.aspx
Ryan, that is super-kewl!!!
Now, if I could just get the shop to upgrade to Server2003, ...
Josh

Measuring index usage

I'm looking for a way to monitor index usage, over time, on all user tables
in a db, in order to determine which ones are getting hit the most and which
may not be getting used at all.
Any suggestions?
Thanks
--
MGMG-
Check out the article below. I think it will get you moving in the right
direction.
http://www.sqlmag.com/Article/ArticleID/38789/sql_server_38789.html
--
Thomas
"MGeles" wrote:
> I'm looking for a way to monitor index usage, over time, on all user tables
> in a db, in order to determine which ones are getting hit the most and which
> may not be getting used at all.
> Any suggestions?
> Thanks
> --
> MG|||If you are running SQL Server 2005, you can use the new
sys.dm_db_index_operational_stats management view:
http://msdn2.microsoft.com/en-us/library/ms174281.aspx
--
Ryan Stonecipher
Microsoft Sql Server Storage Engine, DBCC
This posting is provided "AS IS" with no warranties, and confers no rights.
"MGeles" <michael.geles@.thomson.com> wrote in message
news:06668ED5-FCC7-4D62-9169-1F70E936D43B@.microsoft.com...
> I'm looking for a way to monitor index usage, over time, on all user
> tables
> in a db, in order to determine which ones are getting hit the most and
> which
> may not be getting used at all.
> Any suggestions?
> Thanks
> --
> MG|||On Thu, 27 Apr 2006 12:28:16 -0700, "Ryan Stonecipher [MSFT]"
<ryanston@.microsoft.com> wrote:
>If you are running SQL Server 2005, you can use the new
>sys.dm_db_index_operational_stats management view:
>http://msdn2.microsoft.com/en-us/library/ms174281.aspx
Ryan, that is super-kewl!!!
Now, if I could just get the shop to upgrade to Server2003, ...
Josh

Measuring daily Inserts/updates on a production databse

I want to measure updates/Insertion rate of my databse in order to measure that how percent the databses is booked for insert and update.

can some one can suggest me the mechanism or other resource for doing this work...

thanxs in advance

It is not very clear what kind of data you are hoping to capture.

Perhaps looking at some of the Performance Monitor counters could help.

Perhaps some of the dynamic system views, such as: sys.dm_db_file_space_usage

|||I want to measure/calculate that how many number of Inserts and Updates operated on my database let say AAA|||

probably you want to find out the number of transaction per database. Read : http://msdn2.microsoft.com/en-us/library/ms189883.aspx.

Madhu

|||In SQL 2005 you can also look at sys.dm_db_index_operational_stats.sql

Monday, March 19, 2012

Measure database traffic & growth

I need to measure database traffic & changes in order to estimate possible network traffic over a WAN link & to predict future storage needs. How should I go about this?
Thanks
You could run a performance monitor and add SQL related counters that'll
help. Also add counters such as Disk, etc to measure Disk I/O.
thanks.
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.

Measure database traffic & growth

I need to measure database traffic & changes in order to estimate possible network traffic over a WAN link & to predict future storage needs. How should I go about this?
ThanksYou could run a performance monitor and add SQL related counters that'll
help. Also add counters such as Disk, etc to measure Disk I/O.
thanks.
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.

Measure database traffic & growth

I need to measure database traffic & changes in order to estimate possible n
etwork traffic over a WAN link & to predict future storage needs. How shoul
d I go about this?
ThanksYou could run a performance monitor and add SQL related counters that'll
help. Also add counters such as Disk, etc to measure Disk I/O.
thanks.
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.

MDX's ORDER Function

Hi

I'm trying to order rows returned by a MDX query using ORDER function. It seems that I don't use it properly. Here is the query from the sample AS Database, AdventureWork.

WITH MEMBER [Measures].DIFF AS
'([Customer].[Country].CURRENTMEMBER, [Measures].[Internet Sales Amount])
-
([Customer].[Country].&[Australia], [Measures].[Internet Sales Amount])'
SELECT [Measures].DIFF ON COLUMNS,
ORDER([Customer].[Country].MEMBERS, [Measures].DIFF, BDESC) ON ROWS
FROM [Adventure Works]

what it returns is:

All Customers $20,297,676.64
United States $328,788.93
Australia $0.00
United Kingdom ($5,669,288.37)
Germany ($6,166,688.25)
France ($6,416,982.87)
Canada ($7,083,155.72)

I expected to see "Australia" at the end of the list and "All Customers" on top of it.
Any Idea?

Thanks in advance,
AmirThe results look correct to me. Why do you expect Australia at the end ? It's DIFF is 0 which is bigger then negative diffs of other countries.|||Sorry about that.
I didn't realize there is a bracket arround negative numbers.

Thanks

Saturday, February 25, 2012

MDX query (was "syntax error")

" ORDER ( [Accounting Date].[Account Week].Members , DESC ) ON ROWS "
what is wrong with this line?1. the BY keyword is missing
2. the database/table/column names appear mixed up
3. the comma shouldn't be there
4. the parentheses shouldn't be there
5. the ON ROWS shouldn't be there|||im using MDX not sql yeah?

any ideas for my date sorting query

THANKS 4 REPLYIN!|||what's MDX?|||when using cubes in analysis manager??|||yeah, sorry, i had never heard of it, but a quick search on google showed some interesting results

for example, i don't see an ORDER clause

http://msdn.microsoft.com/library/en-us/olapdmad/agmdxbasics_0v7d.asp|||thanks mate...
order is introduced when you wnat to sort teh result!!!

Thanks enyway!!! : )|||I am creating a OLAP system, where a result table row is a time property. They have options of year, quarter, month or week.

It is all working fine, and actually creates the MDX query depending on the users choice of time property!!! problem is if they choose month or week, the result is in no order... I want the system to display the results in order eg week 1 - week 52

any ideas??|||I am creating a system, where the result table has a row with time in it The user has the option of seeing the data on year, quarter, month or week.

It is all working fine, and actually creates the MDX query depending on the users choice is of teh above!!! problem is if they choose month or week, the result is in no order... I want the system to display the results in order eg week 1 - week 52

any ideas??|||[ moderator note: merging this thread with your other one that is essentially the same question ]

Monday, February 20, 2012

MDX ORDER() QUESTION

Hello,

I'm trying to re-order my time hierarchy, from ascending to descending. When I use the following order statement, the years order descending, but the months remain ascending. How can I simply reverse the default order? Thanks.

(ORDER([Period Dim].[Calendar Hier].[Calendar Month].MEMBERS,[Period Dim].[Calendar Hier].CURRENTMEMBER.MEMBER_KEY,DESC)

results:

Calendar Year

Calendar Month

2006

"JANUARY 2006

2006

"FEBRUARY 2006

2005

"JANUARY 2005

2005

"FEBRUARY 2005

2005

"MARCH 2005

Try using MEMBER_VALUE instead of MEMBER_KEY. That seemed to work when I tried to reproduce using Adventure Works. See the query below.

HTH,

Dave Fackler

select

[Measures].[Internet Order Count] on columns,

Order([Date].[Calendar].[Month].Members, [Date].[Calendar].CurrentMember.Member_Value, bdesc) on rows

from

[Adventure Works]

|||

When I've reversed sets, I've found that method (MemberValue) to be VERY slow..
I just ran the query above and it was 33s.

This is 2s

select

[Measures].[Internet Order Count] on columns,

Order([Date].[Calendar].[Month].Members, [Date].[Calendar].CurrentMember.Properties ("ID", TYPED), bdesc) on rows

from

[Adventure Works]

MDX function ORDER over CROSSJOINed Set

Hello!

I have simple MDX query (SSAS2005):

SELECT
{ [Date].[Calendar].[Calendar Year].&[2004] } ON COLUMNS ,
ORDER(
DESCENDANTS( [Product].[Product Model Categories].[All Products], [Product].[Product Model Categories].[Subcategory] ) *
{[Product].[Size].[All Products], DESCENDANTS([Product].[Size].[All Products], [Product].[Size].[Size]) },
[Measures].[Reseller Sales Amount],
DESC) ON ROWS
FROM [Adventure Works]
WHERE ( [Measures].[Reseller Sales Amount] )

Why members of [Product].[Product Model Categories].[Subcategory] is not arranged?

It is, you haven't specified to break the hierarchy order in the ORDER function and you're not sorting by the column you're displaying. Try the following query:

SELECT

{ [Date].[Calendar].[Calendar Year].&[2004] } ON COLUMNS ,

ORDER(

DESCENDANTS( [Product].[Product Model Categories].[All Products], [Product].[Product Model Categories].[Subcategory] ) *

{[Product].[Size].[All Products], DESCENDANTS([Product].[Size].[All Products], [Product].[Size].[Size]) },

([Measures].[Reseller Sales Amount],[Date].[Calendar].[Calendar Year].&[2004]),

BDESC) ON ROWS

FROM [Adventure Works]

WHERE ( [Measures].[Reseller Sales Amount] )

I've highlighted in red the bits that I've added. It's easy to forget to add the 'B' in front of ASC and DESC, and you have to remember that ORDER won't pick up on any selection you've made on columns - you need to specify the column you want to sort by by adding it to the tuple in the second parameter.

HTH,

Chris

|||

Hi, Chris! Thanks for answer, but...

the hierarchy should be kept. Members of both dimensions should be arranged in the descending order. In the MSAS2000 function ORDER worked correctly. Here is a similar example for Foodmart2000, "Cities" are sorted in the desc and "Education level" is sorted inside of cities too.

SELECT { [Time].&[1997] } ON COLUMNS ,
ORDER(
{
DESCENDANTS( [Customers].[All Customers], [Customers].[City] ) *
{ [Education Level].[All Education Level], DESCENDANTS( [Education Level].[All Education Level], [Education Level].[Education Level] ) }
},
( [Time].&[1997] ),
DESC
) ON ROWS
FROM [Sales]
WHERE ( [Measures].[Unit Sales] )

http://img206.imageshack.us/img206/3055/ordermsas200eg4.jpg

|||

Ah, I see what you mean. This looks like a bug to me - you should report it at Connect (http://connect.microsoft.com/).

In the meantime, does the following query do what you want?

SELECT

{ [Date].[Calendar].[Calendar Year].&[2004] } ON COLUMNS ,

GENERATE(

ORDER(

DESCENDANTS( [Product].[Product Model Categories].[All Products], [Product].[Product Model Categories].[Subcategory] )

,([Measures].[Reseller Sales Amount],[Date].[Calendar].[Calendar Year].&[2004]), DESC)

, [Product].[Product Model Categories].CURRENTMEMBER

*

ORDER(

{[Product].[Size].[All Products], DESCENDANTS([Product].[Size].[All Products], [Product].[Size].[Size]) }

,([Measures].[Reseller Sales Amount],[Date].[Calendar].[Calendar Year].&[2004],[Product].[Product Model Categories].CURRENTMEMBER), DESC)

)

ON ROWS

FROM [Adventure Works]

WHERE ( [Measures].[Reseller Sales Amount] )

Chris

|||

I have made so, but If I need 5-7 crossjoined dimensions?
So many calls instead one ORDER!!!

Thanks.