Monday, March 26, 2012
Latch wait time
(12-20 sec) for LATCH_EX? Total average disk queue depth << 1, CPU at 40%,
not many inserts, client side cursors.
If the client side cursors are not detached from the main data source, that
could do it. Also, just the network traffic load to get it into a
scrollable client side cursor could cause excess latches.
What does you estimated execution plan look like?
Sincerely,
Anthony Thomas
"Bob S" <noone@.nowhere.com> wrote in message
news:uhNTPu4yEHA.1652@.TK2MSFTNGP11.phx.gbl...
> Does anyone know the potential causes of a high average latch wait time
> (12-20 sec) for LATCH_EX? Total average disk queue depth << 1, CPU at
40%,
> not many inserts, client side cursors.
>
|||You may want to monitor memory (vs disks) for this. You can
find explanations in the Latch_x section of the following
article:
http://www.sqldev.net/articles/WaitTypes.htm
-Sue
On Mon, 15 Nov 2004 22:22:52 -0500, "Bob S"
<noone@.nowhere.com> wrote:
>Does anyone know the potential causes of a high average latch wait time
>(12-20 sec) for LATCH_EX? Total average disk queue depth << 1, CPU at 40%,
>not many inserts, client side cursors.
>
Latch wait time
(12-20 sec) for LATCH_EX? Total average disk queue depth << 1, CPU at 40%,
not many inserts, client side cursors.If the client side cursors are not detached from the main data source, that
could do it. Also, just the network traffic load to get it into a
scrollable client side cursor could cause excess latches.
What does you estimated execution plan look like?
Sincerely,
Anthony Thomas
"Bob S" <noone@.nowhere.com> wrote in message
news:uhNTPu4yEHA.1652@.TK2MSFTNGP11.phx.gbl...
> Does anyone know the potential causes of a high average latch wait time
> (12-20 sec) for LATCH_EX? Total average disk queue depth << 1, CPU at
40%,
> not many inserts, client side cursors.
>|||You may want to monitor memory (vs disks) for this. You can
find explanations in the Latch_x section of the following
article:
http://www.sqldev.net/articles/WaitTypes.htm
-Sue
On Mon, 15 Nov 2004 22:22:52 -0500, "Bob S"
<noone@.nowhere.com> wrote:
>Does anyone know the potential causes of a high average latch wait time
>(12-20 sec) for LATCH_EX? Total average disk queue depth << 1, CPU at 40%,
>not many inserts, client side cursors.
>
Latch wait time
(12-20 sec) for LATCH_EX? Total average disk queue depth << 1, CPU at 40%,
not many inserts, client side cursors.If the client side cursors are not detached from the main data source, that
could do it. Also, just the network traffic load to get it into a
scrollable client side cursor could cause excess latches.
What does you estimated execution plan look like?
Sincerely,
Anthony Thomas
"Bob S" <noone@.nowhere.com> wrote in message
news:uhNTPu4yEHA.1652@.TK2MSFTNGP11.phx.gbl...
> Does anyone know the potential causes of a high average latch wait time
> (12-20 sec) for LATCH_EX? Total average disk queue depth << 1, CPU at
40%,
> not many inserts, client side cursors.
>|||You may want to monitor memory (vs disks) for this. You can
find explanations in the Latch_x section of the following
article:
http://www.sqldev.net/articles/WaitTypes.htm
-Sue
On Mon, 15 Nov 2004 22:22:52 -0500, "Bob S"
<noone@.nowhere.com> wrote:
>Does anyone know the potential causes of a high average latch wait time
>(12-20 sec) for LATCH_EX? Total average disk queue depth << 1, CPU at 40%,
>not many inserts, client side cursors.
>
Wednesday, March 21, 2012
Last Three Months of invoice totals
being:
(total) (total) (total for month so
far)
feb 2004 mar 2004 apr 2004
60,000 45,000 38,000
the base table would contain invoice details with, amongst other things, dat
e, amount, manager etcLofty
Please post DDL+ sample data
Also look at DATEADD sysstem function in the BOL.
"Lofty" <anonymous@.discussions.microsoft.com> wrote in message
news:91AECF48-34A7-4749-B562-7DD4389AE249@.microsoft.com...
> i want my sp to return say for today nov 23rd 2004, three columns of
totals being:
> (total) (total) (total for month
so far)
> feb 2004 mar 2004 apr 2004
> 60,000 45,000 38,000
> the base table would contain invoice details with, amongst other things,
date, amount, manager etcsql
Last Three Months of invoice totals
(total) (total) (total for month so far
feb 2004 mar 2004 apr 200
60,000 45,000 38,00
the base table would contain invoice details with, amongst other things, date, amount, manager etcLofty
Please post DDL+ sample data
Also look at DATEADD sysstem function in the BOL.
"Lofty" <anonymous@.discussions.microsoft.com> wrote in message
news:91AECF48-34A7-4749-B562-7DD4389AE249@.microsoft.com...
> i want my sp to return say for today nov 23rd 2004, three columns of
totals being:
> (total) (total) (total for month
so far)
> feb 2004 mar 2004 apr 2004
> 60,000 45,000 38,000
> the base table would contain invoice details with, amongst other things,
date, amount, manager etc
Last Three Months of invoice totals
(total) (total) (total for month so far)
feb 2004 mar 2004 apr 2004
60,000 45,000 38,000
the base table would contain invoice details with, amongst other things, date, amount, manager etc
Lofty
Please post DDL+ sample data
Also look at DATEADD sysstem function in the BOL.
"Lofty" <anonymous@.discussions.microsoft.com> wrote in message
news:91AECF48-34A7-4749-B562-7DD4389AE249@.microsoft.com...
> i want my sp to return say for today nov 23rd 2004, three columns of
totals being:
> (total) (total) (total for month
so far)
> feb 2004 mar 2004 apr 2004
> 60,000 45,000 38,000
> the base table would contain invoice details with, amongst other things,
date, amount, manager etc
Last Populated Quarter''s Data
Currently I have the following calculation to get the closing Inventory balance for a year
Code Snippet
([Measures].[Total Square Area], ClosingPeriod([Time].[Quarter].[Quarter]))But for 2007 for example this is Empty as Q4 has no data.
I know there must be a simple way to return the Last NON EMPTY Quarter's balance but I am having a fog on it....
Any help or link to an example would be great!
Will
Maybe this will work:
Code Snippet
([Measures].[Total Square Area],
Tail(NonEmpty([Time].[Quarter].[Quarter],
[Measures].[Total Square Area])).Item(0))
|||Hi Deepak,
Unfortunately that returns an error
"Token Error, Syntax is not valid"
I figured it must be close though
|||Well, here's a sample Adventure Works query, based on the above code snippet, which returns the last populated Quarter Exchange Rate for DeutscheMarks in FY2002 - a value of .49 in FY2002Q2 (after which the Euro replaced the DM):
Code Snippet
With
Member [Measures].[QuarterExchange] as
([Measures].[Average Rate],
Tail(NonEmpty(
[Date].[Fiscal Quarter of Year].[Fiscal Quarter of Year],
[Measures].[Average Rate])).Item(0)),
FORMAT_STRING = '#.00'
select
{[Measures].[QuarterExchange]} on 0
from [Adventure Works]
where ([Date].[Fiscal].[Fiscal Year].&[2002],
[Destination Currency].[Destination Currency].&[Deutsche Mark])
-
QuarterExchange
.49
Hi Will,
Yes, this is new in AS 2005 - in AS 2000, you could try NonEmptyCrossJoin(), like:
Code Snippet
([Measures].[Total Square Area],
Tail(NonEmptyCrossJoin([Time].[Quarter].Members,
{[Measures].[Total Square Area]}, 1)).Item(0).Item(0))
For future reference, you might want to mention explicitly that you're asking a question specific to AS 2000, given that SQL Server 2005 was launched nearly 2 years ago, and we're on the threshold of SQL Server 2008
MDX: NonEmpty, Exists and evil NonEmptyCrossJoin
|||Hi,
Thanks - sorry about the confusion with versions...
I was using 2005 at my old place. No I am 2005 for SSIS & SSRS but they won't budge from 2000 for AS just yet so it's a real pain & I tend to forget to mention it.
Sorry, & thanks for the help
Last Populated Quarter''s Data
Currently I have the following calculation to get the closing Inventory balance for a year
Code Snippet
([Measures].[Total Square Area], ClosingPeriod([Time].[Quarter].[Quarter]))But for 2007 for example this is Empty as Q4 has no data.
I know there must be a simple way to return the Last NON EMPTY Quarter's balance but I am having a fog on it....
Any help or link to an example would be great!
Will
Maybe this will work:
Code Snippet
([Measures].[Total Square Area],
Tail(NonEmpty([Time].[Quarter].[Quarter],
[Measures].[Total Square Area])).Item(0))
|||Hi Deepak,
Unfortunately that returns an error
"Token Error, Syntax is not valid"
I figured it must be close though
|||Well, here's a sample Adventure Works query, based on the above code snippet, which returns the last populated Quarter Exchange Rate for DeutscheMarks in FY2002 - a value of .49 in FY2002Q2 (after which the Euro replaced the DM):
Code Snippet
With
Member [Measures].[QuarterExchange] as
([Measures].[Average Rate],
Tail(NonEmpty(
[Date].[Fiscal Quarter of Year].[Fiscal Quarter of Year],
[Measures].[Average Rate])).Item(0)),
FORMAT_STRING = '#.00'
select
{[Measures].[QuarterExchange]} on 0
from [Adventure Works]
where ([Date].[Fiscal].[Fiscal Year].&[2002],
[Destination Currency].[Destination Currency].&[Deutsche Mark])
-
QuarterExchange
.49
Hi Will,
Yes, this is new in AS 2005 - in AS 2000, you could try NonEmptyCrossJoin(), like:
Code Snippet
([Measures].[Total Square Area],
Tail(NonEmptyCrossJoin([Time].[Quarter].Members,
{[Measures].[Total Square Area]}, 1)).Item(0).Item(0))
For future reference, you might want to mention explicitly that you're asking a question specific to AS 2000, given that SQL Server 2005 was launched nearly 2 years ago, and we're on the threshold of SQL Server 2008
MDX: NonEmpty, Exists and evil NonEmptyCrossJoin
|||Hi,
Thanks - sorry about the confusion with versions...
I was using 2005 at my old place. No I am 2005 for SSIS & SSRS but they won't budge from 2000 for AS just yet so it's a real pain & I tend to forget to mention it.
Sorry, & thanks for the help
Last Populated Quarter''s Data
Currently I have the following calculation to get the closing Inventory balance for a year
Code Snippet
([Measures].[Total Square Area], ClosingPeriod([Time].[Quarter].[Quarter]))But for 2007 for example this is Empty as Q4 has no data.
I know there must be a simple way to return the Last NON EMPTY Quarter's balance but I am having a fog on it....
Any help or link to an example would be great!
Will
Maybe this will work:
Code Snippet
([Measures].[Total Square Area],
Tail(NonEmpty([Time].[Quarter].[Quarter],
[Measures].[Total Square Area])).Item(0))
|||Hi Deepak,
Unfortunately that returns an error
"Token Error, Syntax is not valid"
I figured it must be close though
|||Well, here's a sample Adventure Works query, based on the above code snippet, which returns the last populated Quarter Exchange Rate for DeutscheMarks in FY2002 - a value of .49 in FY2002Q2 (after which the Euro replaced the DM):
Code Snippet
With
Member [Measures].[QuarterExchange] as
([Measures].[Average Rate],
Tail(NonEmpty(
[Date].[Fiscal Quarter of Year].[Fiscal Quarter of Year],
[Measures].[Average Rate])).Item(0)),
FORMAT_STRING = '#.00'
select
{[Measures].[QuarterExchange]} on 0
from [Adventure Works]
where ([Date].[Fiscal].[Fiscal Year].&[2002],
[Destination Currency].[Destination Currency].&[Deutsche Mark])
-
QuarterExchange
.49
Hi Will,
Yes, this is new in AS 2005 - in AS 2000, you could try NonEmptyCrossJoin(), like:
Code Snippet
([Measures].[Total Square Area],
Tail(NonEmptyCrossJoin([Time].[Quarter].Members,
{[Measures].[Total Square Area]}, 1)).Item(0).Item(0))
For future reference, you might want to mention explicitly that you're asking a question specific to AS 2000, given that SQL Server 2005 was launched nearly 2 years ago, and we're on the threshold of SQL Server 2008
MDX: NonEmpty, Exists and evil NonEmptyCrossJoin
|||Hi,
Thanks - sorry about the confusion with versions...
I was using 2005 at my old place. No I am 2005 for SSIS & SSRS but they won't budge from 2000 for AS just yet so it's a real pain & I tend to forget to mention it.
Sorry, & thanks for the help
Last Populated Quarter''s Data
Currently I have the following calculation to get the closing Inventory balance for a year
Code Snippet
([Measures].[Total Square Area], ClosingPeriod([Time].[Quarter].[Quarter]))But for 2007 for example this is Empty as Q4 has no data.
I know there must be a simple way to return the Last NON EMPTY Quarter's balance but I am having a fog on it....
Any help or link to an example would be great!
Will
Maybe this will work:
Code Snippet
([Measures].[Total Square Area],
Tail(NonEmpty([Time].[Quarter].[Quarter],
[Measures].[Total Square Area])).Item(0))
|||Hi Deepak,
Unfortunately that returns an error
"Token Error, Syntax is not valid"
I figured it must be close though
|||Well, here's a sample Adventure Works query, based on the above code snippet, which returns the last populated Quarter Exchange Rate for DeutscheMarks in FY2002 - a value of .49 in FY2002Q2 (after which the Euro replaced the DM):
Code Snippet
With
Member [Measures].[QuarterExchange] as
([Measures].[Average Rate],
Tail(NonEmpty(
[Date].[Fiscal Quarter of Year].[Fiscal Quarter of Year],
[Measures].[Average Rate])).Item(0)),
FORMAT_STRING = '#.00'
select
{[Measures].[QuarterExchange]} on 0
from [Adventure Works]
where ([Date].[Fiscal].[Fiscal Year].&[2002],
[Destination Currency].[Destination Currency].&[Deutsche Mark])
-
QuarterExchange
.49
Hi Will,
Yes, this is new in AS 2005 - in AS 2000, you could try NonEmptyCrossJoin(), like:
Code Snippet
([Measures].[Total Square Area],
Tail(NonEmptyCrossJoin([Time].[Quarter].Members,
{[Measures].[Total Square Area]}, 1)).Item(0).Item(0))
For future reference, you might want to mention explicitly that you're asking a question specific to AS 2000, given that SQL Server 2005 was launched nearly 2 years ago, and we're on the threshold of SQL Server 2008
MDX: NonEmpty, Exists and evil NonEmptyCrossJoin
|||Hi,
Thanks - sorry about the confusion with versions...
I was using 2005 at my old place. No I am 2005 for SSIS & SSRS but they won't budge from 2000 for AS just yet so it's a real pain & I tend to forget to mention it.
Sorry, & thanks for the help
Last Populated Quarter''s Data
Currently I have the following calculation to get the closing Inventory balance for a year
Code Snippet
([Measures].[Total Square Area], ClosingPeriod([Time].[Quarter].[Quarter]))But for 2007 for example this is Empty as Q4 has no data.
I know there must be a simple way to return the Last NON EMPTY Quarter's balance but I am having a fog on it....
Any help or link to an example would be great!
Will
Maybe this will work:
Code Snippet
([Measures].[Total Square Area],
Tail(NonEmpty([Time].[Quarter].[Quarter],
[Measures].[Total Square Area])).Item(0))
|||Hi Deepak,
Unfortunately that returns an error
"Token Error, Syntax is not valid"
I figured it must be close though
|||Well, here's a sample Adventure Works query, based on the above code snippet, which returns the last populated Quarter Exchange Rate for DeutscheMarks in FY2002 - a value of .49 in FY2002Q2 (after which the Euro replaced the DM):
Code Snippet
With
Member [Measures].[QuarterExchange] as
([Measures].[Average Rate],
Tail(NonEmpty(
[Date].[Fiscal Quarter of Year].[Fiscal Quarter of Year],
[Measures].[Average Rate])).Item(0)),
FORMAT_STRING = '#.00'
select
{[Measures].[QuarterExchange]} on 0
from [Adventure Works]
where ([Date].[Fiscal].[Fiscal Year].&[2002],
[Destination Currency].[Destination Currency].&[Deutsche Mark])
-
QuarterExchange
.49
Hi Will,
Yes, this is new in AS 2005 - in AS 2000, you could try NonEmptyCrossJoin(), like:
Code Snippet
([Measures].[Total Square Area],
Tail(NonEmptyCrossJoin([Time].[Quarter].Members,
{[Measures].[Total Square Area]}, 1)).Item(0).Item(0))
For future reference, you might want to mention explicitly that you're asking a question specific to AS 2000, given that SQL Server 2005 was launched nearly 2 years ago, and we're on the threshold of SQL Server 2008
MDX: NonEmpty, Exists and evil NonEmptyCrossJoin
|||Hi,
Thanks - sorry about the confusion with versions...
I was using 2005 at my old place. No I am 2005 for SSIS & SSRS but they won't budge from 2000 for AS just yet so it's a real pain & I tend to forget to mention it.
Sorry, & thanks for the help
Last Populated Quarter''s Data
Currently I have the following calculation to get the closing Inventory balance for a year
Code Snippet
([Measures].[Total Square Area], ClosingPeriod([Time].[Quarter].[Quarter]))But for 2007 for example this is Empty as Q4 has no data.
I know there must be a simple way to return the Last NON EMPTY Quarter's balance but I am having a fog on it....
Any help or link to an example would be great!
Will
Maybe this will work:
Code Snippet
([Measures].[Total Square Area],
Tail(NonEmpty([Time].[Quarter].[Quarter],
[Measures].[Total Square Area])).Item(0))
|||Hi Deepak,
Unfortunately that returns an error
"Token Error, Syntax is not valid"
I figured it must be close though
|||Well, here's a sample Adventure Works query, based on the above code snippet, which returns the last populated Quarter Exchange Rate for DeutscheMarks in FY2002 - a value of .49 in FY2002Q2 (after which the Euro replaced the DM):
Code Snippet
With
Member [Measures].[QuarterExchange] as
([Measures].[Average Rate],
Tail(NonEmpty(
[Date].[Fiscal Quarter of Year].[Fiscal Quarter of Year],
[Measures].[Average Rate])).Item(0)),
FORMAT_STRING = '#.00'
select
{[Measures].[QuarterExchange]} on 0
from [Adventure Works]
where ([Date].[Fiscal].[Fiscal Year].&[2002],
[Destination Currency].[Destination Currency].&[Deutsche Mark])
-
QuarterExchange
.49
Hi Will,
Yes, this is new in AS 2005 - in AS 2000, you could try NonEmptyCrossJoin(), like:
Code Snippet
([Measures].[Total Square Area],
Tail(NonEmptyCrossJoin([Time].[Quarter].Members,
{[Measures].[Total Square Area]}, 1)).Item(0).Item(0))
For future reference, you might want to mention explicitly that you're asking a question specific to AS 2000, given that SQL Server 2005 was launched nearly 2 years ago, and we're on the threshold of SQL Server 2008
MDX: NonEmpty, Exists and evil NonEmptyCrossJoin
|||Hi,
Thanks - sorry about the confusion with versions...
I was using 2005 at my old place. No I am 2005 for SSIS & SSRS but they won't budge from 2000 for AS just yet so it's a real pain & I tend to forget to mention it.
Sorry, & thanks for the help
Last Populated Quarter''s Data
Currently I have the following calculation to get the closing Inventory balance for a year
Code Snippet
([Measures].[Total Square Area], ClosingPeriod([Time].[Quarter].[Quarter]))But for 2007 for example this is Empty as Q4 has no data.
I know there must be a simple way to return the Last NON EMPTY Quarter's balance but I am having a fog on it....
Any help or link to an example would be great!
Will
Maybe this will work:
Code Snippet
([Measures].[Total Square Area],
Tail(NonEmpty([Time].[Quarter].[Quarter],
[Measures].[Total Square Area])).Item(0))
|||Hi Deepak,
Unfortunately that returns an error
"Token Error, Syntax is not valid"
I figured it must be close though
|||Well, here's a sample Adventure Works query, based on the above code snippet, which returns the last populated Quarter Exchange Rate for DeutscheMarks in FY2002 - a value of .49 in FY2002Q2 (after which the Euro replaced the DM):
Code Snippet
With
Member [Measures].[QuarterExchange] as
([Measures].[Average Rate],
Tail(NonEmpty(
[Date].[Fiscal Quarter of Year].[Fiscal Quarter of Year],
[Measures].[Average Rate])).Item(0)),
FORMAT_STRING = '#.00'
select
{[Measures].[QuarterExchange]} on 0
from [Adventure Works]
where ([Date].[Fiscal].[Fiscal Year].&[2002],
[Destination Currency].[Destination Currency].&[Deutsche Mark])
-
QuarterExchange
.49
Hi Will,
Yes, this is new in AS 2005 - in AS 2000, you could try NonEmptyCrossJoin(), like:
Code Snippet
([Measures].[Total Square Area],
Tail(NonEmptyCrossJoin([Time].[Quarter].Members,
{[Measures].[Total Square Area]}, 1)).Item(0).Item(0))
For future reference, you might want to mention explicitly that you're asking a question specific to AS 2000, given that SQL Server 2005 was launched nearly 2 years ago, and we're on the threshold of SQL Server 2008
MDX: NonEmpty, Exists and evil NonEmptyCrossJoin
|||Hi,
Thanks - sorry about the confusion with versions...
I was using 2005 at my old place. No I am 2005 for SSIS & SSRS but they won't budge from 2000 for AS just yet so it's a real pain & I tend to forget to mention it.
Sorry, & thanks for the help