Showing posts with label averaged. Show all posts
Showing posts with label averaged. Show all posts

Tuesday, March 20, 2012

Alert & Cache Hit Ratio

Hello World,
How can I set up an alert when the Cache Hit Ratio has averaged lower than
60% for the past n number of hours (with 5 seconds interval) ?
We are using Cache Hit Ratio to determine if we need to add more RAM to the
server. However, if the number above only hit the alert once in two weeks, i
s
it the time to consider adding RAM? If not, when would be?See if this helps:
Tips for Using Performance Monitor
Memory Counters
[url]http://www.sql-server-performance.com/performance_monitor_counters_memory.asp[/url
]
AMB
"C TO" wrote:

> Hello World,
> How can I set up an alert when the Cache Hit Ratio has averaged lower than
> 60% for the past n number of hours (with 5 seconds interval) ?
> We are using Cache Hit Ratio to determine if we need to add more RAM to th
e
> server. However, if the number above only hit the alert once in two weeks,
is
> it the time to consider adding RAM? If not, when would be?|||If your Cache Hit Ration is anywhere near 60% you either need to optimize
your queries / indexes or could use more memory. I worry if I see it get
just a few % below 100%. You should also monitor the page life expectancy
counter to see if you need more memory.
Andrew J. Kelly SQL MVP
"C TO" <CTO@.discussions.microsoft.com> wrote in message
news:565918DF-F2A5-4A95-A707-80AFF284AEE6@.microsoft.com...
> Hello World,
> How can I set up an alert when the Cache Hit Ratio has averaged lower than
> 60% for the past n number of hours (with 5 seconds interval) ?
> We are using Cache Hit Ratio to determine if we need to add more RAM to
> the
> server. However, if the number above only hit the alert once in two weeks,
> is
> it the time to consider adding RAM? If not, when would be?

Alert & Cache Hit Ratio

Hello World,
How can I set up an alert when the Cache Hit Ratio has averaged lower than
60% for the past n number of hours (with 5 seconds interval) ?
We are using Cache Hit Ratio to determine if we need to add more RAM to the
server. However, if the number above only hit the alert once in two weeks, is
it the time to consider adding RAM? If not, when would be?
See if this helps:
Tips for Using Performance Monitor
Memory Counters
http://www.sql-server-performance.co...ers_memory.asp
AMB
"C TO" wrote:

> Hello World,
> How can I set up an alert when the Cache Hit Ratio has averaged lower than
> 60% for the past n number of hours (with 5 seconds interval) ?
> We are using Cache Hit Ratio to determine if we need to add more RAM to the
> server. However, if the number above only hit the alert once in two weeks, is
> it the time to consider adding RAM? If not, when would be?
|||If your Cache Hit Ration is anywhere near 60% you either need to optimize
your queries / indexes or could use more memory. I worry if I see it get
just a few % below 100%. You should also monitor the page life expectancy
counter to see if you need more memory.
Andrew J. Kelly SQL MVP
"C TO" <CTO@.discussions.microsoft.com> wrote in message
news:565918DF-F2A5-4A95-A707-80AFF284AEE6@.microsoft.com...
> Hello World,
> How can I set up an alert when the Cache Hit Ratio has averaged lower than
> 60% for the past n number of hours (with 5 seconds interval) ?
> We are using Cache Hit Ratio to determine if we need to add more RAM to
> the
> server. However, if the number above only hit the alert once in two weeks,
> is
> it the time to consider adding RAM? If not, when would be?

Alert & Cache Hit Ratio

Hello World,
How can I set up an alert when the Cache Hit Ratio has averaged lower than
60% for the past n number of hours (with 5 seconds interval) ?
We are using Cache Hit Ratio to determine if we need to add more RAM to the
server. However, if the number above only hit the alert once in two weeks, is
it the time to consider adding RAM? If not, when would be?See if this helps:
Tips for Using Performance Monitor
Memory Counters
http://www.sql-server-performance.com/performance_monitor_counters_memory.asp
AMB
"C TO" wrote:
> Hello World,
> How can I set up an alert when the Cache Hit Ratio has averaged lower than
> 60% for the past n number of hours (with 5 seconds interval) ?
> We are using Cache Hit Ratio to determine if we need to add more RAM to the
> server. However, if the number above only hit the alert once in two weeks, is
> it the time to consider adding RAM? If not, when would be?|||If your Cache Hit Ration is anywhere near 60% you either need to optimize
your queries / indexes or could use more memory. I worry if I see it get
just a few % below 100%. You should also monitor the page life expectancy
counter to see if you need more memory.
--
Andrew J. Kelly SQL MVP
"C TO" <CTO@.discussions.microsoft.com> wrote in message
news:565918DF-F2A5-4A95-A707-80AFF284AEE6@.microsoft.com...
> Hello World,
> How can I set up an alert when the Cache Hit Ratio has averaged lower than
> 60% for the past n number of hours (with 5 seconds interval) ?
> We are using Cache Hit Ratio to determine if we need to add more RAM to
> the
> server. However, if the number above only hit the alert once in two weeks,
> is
> it the time to consider adding RAM? If not, when would be?

Thursday, March 8, 2012

Aggregate Problem

When I run the my code in Northwind, the ExtendedPrice is wrong because
UnitPrice is averaged. I have AVG([Order Details].UnitPrice) AS UnitPrice in
my statement because I couldn't figure out a better aggregate function to
use.
My goal is to simply get a GROUP by Orders.OrderDate and SUM the
ExtendedPrice expression for each date. I probably need some type of
subquery, but not sure how to go about this one.
CODE (used in northwind database):
SELECT Orders.OrderDate, AVG([Order Details].UnitPrice) AS UnitPrice,
COUNT([Order Details].Quantity) AS Qty, AVG(CONVERT(money,
[Order Details].UnitPrice * [Order Details].Quantity)) AS ExtendedPrice
FROM Orders INNER JOIN
[Order Details] ON Orders.OrderID = [Order Details].OrderID
GROUP BY Orders.OrderDateHi
It may be clearer is you give your expected results, but this may be a
starting point!
SELECT O.OrderDate, SUM(D.UnitPrice * D.Quantity) AS ExtendedPrice
FROM Orders O
JOIN [Order Details] D ON O.OrderID = D.OrderID
GROUP BY O.OrderDate
John
"Scott" <sbailey@.mileslumber.com> wrote in message
news:OtlJ$mY3FHA.636@.TK2MSFTNGP10.phx.gbl...
> When I run the my code in Northwind, the ExtendedPrice is wrong because
> UnitPrice is averaged. I have AVG([Order Details].UnitPrice) AS UnitPrice
> in my statement because I couldn't figure out a better aggregate function
> to use.
> My goal is to simply get a GROUP by Orders.OrderDate and SUM the
> ExtendedPrice expression for each date. I probably need some type of
> subquery, but not sure how to go about this one.
> CODE (used in northwind database):
> SELECT Orders.OrderDate, AVG([Order Details].UnitPrice) AS UnitPrice,
> COUNT([Order Details].Quantity) AS Qty, AVG(CONVERT(money,
> [Order Details].UnitPrice * [Order Details].Quantity)) AS
> ExtendedPrice
> FROM Orders INNER JOIN
> [Order Details] ON Orders.OrderID = [Order Details].OrderID
> GROUP BY Orders.OrderDate
>|||that did it. thx.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:uty7J2Y3FHA.3636@.TK2MSFTNGP09.phx.gbl...
> Hi
> It may be clearer is you give your expected results, but this may be a
> starting point!
> SELECT O.OrderDate, SUM(D.UnitPrice * D.Quantity) AS ExtendedPrice
> FROM Orders O
> JOIN [Order Details] D ON O.OrderID = D.OrderID
> GROUP BY O.OrderDate
> John
> "Scott" <sbailey@.mileslumber.com> wrote in message
> news:OtlJ$mY3FHA.636@.TK2MSFTNGP10.phx.gbl...
>