Sys.dm_os_memory_cache_counters Vs. SQL Server:Plan Cache Cache

Feb 15, 2008

Hi guys,

I am looking at the plan caches/cached pages from the perspective of
sys.dm_os_memory_cache_counters and sql serverlan Cache - Cache Pages

For the first one I am using

select (sum(single_pages_kb) + sum(multi_pages_kb) )
from sys.dm_os_memory_cache_counters
where type = 'CACHESTORE_SQLCP' or type = 'CACHESTORE_OBJCP'
a slight change from a query in
http://blogs.msdn.com/sqlprogrammability/

For the second just perfmon.

The first one gives me a count of about 670,000 pages only for the object and query cache and the second one gives me a total of about 100,000 pages for five type of caches including object and query.

If I am using the query from http://blogs.msdn.com/sqlprogrammability/ to determin the plan cache size

select (sum(single_pages_kb) + sum(multi_pages_kb) ) * 8 / (1024.0 * 1024.0) as plan_cache_in_GB
from sys.dm_os_memory_cache_counters
where type = 'CACHESTORE_SQLCP' or type = 'CACHESTORE_OBJCP'

it gives me about 5 GB when in fact my SQL Server it can access only max 2GB with Total and Target Server Memory at about 1.5 GB.

Does anyone have any idea what is going on?

View 2 Replies


ADVERTISEMENT

SQL Server 2008 :: Is Only One Plan Is Kept For One Query In Plan Cache

Mar 14, 2015

Is only one plan is kept for one query in plan cache?

i heard generally hash is created for a query and plan is search with this hash.

View 2 Replies View Related

SQL Server Admin 2014 :: Procedure Plan Cache Is Cleared Automatically

Sep 17, 2015

The plan cache is cleared automatically (every 30-60 seconds) on our high load OLPT server.

Can't find a reason for it. I have been logging procedure cache thru dm_exec_cached_plans, every second for a couple of minutes.

It shows that it doesn't grow beyond 200Mb. SQLserver has 64Gb available.

DBCC FREEPROCCACHE is not executed.
dm_os_memory_clerks shows the same 200Mb max (approximately).

I disabled the SQL Agent, still happens, so it's not a job causing the problem.

I disabled the Resource Governor, still the same problem.

View 9 Replies View Related

Unable To Connect To SQL Database 'MySite-Cache' For Cache Dependency Polling.

Dec 27, 2007

 Im getting this error when trying to set up a cache dependency...are there any special permissions etc?From CS:SqlCacheDependency dep = new SqlCacheDependency("MySite-Cache", "Products");Cache.Insert("Products", de.GetAllProductsList(), dep); From connectionStrings.config:<add name="SiteDB"         connectionString="Data Source=localhost,[port]SQLEXPRESS;Integrated Security=true;User Instance=true; AttachDBFileName=|DataDirectory|ASPNETDB.MDF" providerName="System.Data.SqlClient" />Also tried this using my machinename<add name="SiteDB"         connectionString="Data
Source=<machinename>,[port]SQLEXPRESS;Integrated Security=true;User
Instance=true; AttachDBFileName=|DataDirectory|ASPNETDB.MDF"
providerName="System.Data.SqlClient" /> From web.config:       <caching>          <sqlCacheDependency enabled="true" pollTime="10000">              <databases>                  <add name="MySite-Cache" connectionStringName="SiteDB" pollTime="2000"/>              </databases>          </sqlCacheDependency>                </caching> EDIT: So making progress I can't seem to get the table registered for cache dependency:The sample i have says"aspnet_regsql.exe -E -S .SqlExpress -d aspnetdb -t Customers -et"and the command line response is "Enabling the table for SQL cache dependency..An error has happened.  Details of the exception:The table 'Customers' cannot be found in the database."Where does this "Customers" table come from? There is obviously not an application specific "Customers" table in aspnetdb I'm confused probably more by the example than anything.... 

View 3 Replies View Related

SQL2K - Clean Buffer Cache And Procedure Cache.

May 31, 2007

Is there a way to drop clean buffers at the database level instead of the server/instance level like the undocumented €śDBCC FLUSHPROCINDB (@dbid)€??
Is there a workaround for €śdbo€? to be able to flush procedure and data cache without being elevated to €śsysadmin€? server role?

PS: I am aware of the sp_recompile option that can be used to invalidate cached execution plans.
Thx.

View 1 Replies View Related

Cache Plan Different Using Sp_prepare And Sp_executesql.

Mar 30, 2006

I have a 3rd party application that uses sp_prepare and sp_execute for data retreival. The following statement takes around 40 seconds to run:

declare @P1 int

exec sp_prepare @P1 output, N'@P1 bigint,@P2 bigint,@P3 bigint,@P4 bigint,@P5 bigint,@P6 bigint,@P7 bigint,@P8 bigint', N'SELECT SHAPE ,S_.eminx,S_.eminy,S_.emaxx,S_.emaxy ,SHAPE.fid F_fid,SHAPE.numofpts F_numofpts,SHAPE.entity F_entity,SHAPE.points F_points FROM (SELECT DISTINCT sp_fid,eminx,eminy,emaxx,emaxy FROM SDE.SDE.s162 SP_ WHERE SP_.gx >= @P1 AND SP_.gx <= @P2 AND SP_.gy >= @P3 AND SP_.gy <= @P4 AND SP_.eminx <= @P5 AND SP_.eminy <= @P6 AND SP_.emaxx >= @P7 AND SP_.emaxy >= @P8 ) S_ ,SDE.SDE.ENTORDERLINESEGMENT, SDE.SDE.f162 SHAPE WHERE S_.sp_fid = SHAPE.fid AND SDE.SDE.ENTORDERLINESEGMENT.SHAPE = S_.sp_fid AND (( ORDERID in (16320, 16825) ))', 1 select @P1

exec sp_execute 1, 166, 169, 219, 224, 90269119, 119480870, 88777840, 117193071

The query plan created by sp_prepare is used during the sp_execute but it's very slow compared to running this query ad hoc or with sp_executesql. If I clear the proc cache before running the sp_execute this runs in less than 1 second. The tables used are pretty large (8 - 15 million rows) but are indexed correctly and I've updated the statistics and rebuilt the indexes but neither improves the performance.

Does anyone know why using the sp_prepare statement causes a poor query plan?

Thanks.

Doug Matney

View 6 Replies View Related

Clearing Execution Plan Cache

Sep 6, 2007



Hi,
We have an application which fetches data from a table which has approximately 1 million records.


1. Nearly 25 users will be using this application concurrently.
2. frequent updations will be done to the records in the geographyrolecurriculum table.
3. This table has 1 clustered index and 4 nonclustered index bounded to it.

Problem Statement:
1. Application runs smoothly for 15 - 20 days and after that all the screens throws timeout errors.
When i clear the sys.syscacheobjects its working fine again and screens get loaded quickly.
Please tell me how clearing the syscacheobjects makes the execution fast? and is this the correct way to solve the timeout issue or is there any other alternative?


2. Will the stored procs timeout if the tempdb is full ?

Thanks,
Arunprasad

View 5 Replies View Related

Cache Hit Ratio Vs Buffered Cache Hit Ratio

Mar 13, 2003

On Microsoft performance monitor, what is the difference between SQL Server Cache Manager: Cache Hit Ratio and SQL
Server Buffer Manager: Buffer Cache Hit Ratio? We have a production server where the buffer cache hit ratio is
consistently at 99%, which is normal. However, the cache hit ratio is 73%. What is the difference between the two
hit ratios, and why would we have such a significant difference between the two?

Any help or advice would be much appreciated.

View 5 Replies View Related

SQL Server Vs Cache

Apr 2, 2004

I'm very confused about which dbms to use. I've two choices: MS SQL Server 2000 and Intersystems Cache. Although Cache is post relational I don't know anything about it. However it has object oriented features, I know how to do things in SQL Server.
Can anyone give me the advantages and disadvantages of both systems in this situation?
Thanks in advance.

View 14 Replies View Related

SQL Server Cache.

Dec 4, 2007

Hi all,

We need few clarifications with regard to the caching in SQL Server.

1. When does the SQL Server clears the CACHE or at which event the CACHE gets cleared (specifically execution plans)?

2. Is there any way to retain the execution plans in the CACHE without clearing them ?

3. Can we rely upon the SQL Server CACHE for better performance or the system? We have a stored procedure which takes 25 sec and when the execution plan is cached it takes only 5 sec. So can we rely on execution plan caching in the production environment?

Thanks & Regards,

Hari Haran Arulmozhi

View 2 Replies View Related

Problems With SQL Server Cache Invalidation

Jun 5, 2007

Hi I am using SQL Server cache invalidation with caching in my application.
I have a master page and several other pages that are referring the master page.
I have specified :
<%@ OutputCache Duration="60" VaryByParam="*" SqlDependency="CommandNotification" %> on one of my content page.and I have included the
System.Data.SqlClient.SqlDependency.Start(connectionstring) in my Application_Start.My web.config contains this section as well -
<caching><sqlCacheDependency enabled="true">
<databases><add name="BizPartnerV4" connectionStringName="BizPartnerConnectionString"/>
<add name="DirectBuyBeaverton" connectionStringName="DirectBuyBeavertonConnectionString"/></databases>
</sqlCacheDependency>
I</caching> have also run the aspnet_regsql utility to enable sqlcache dependency for the database.
But my page is not taking the values from cache when the page is refreshed.
Please help.

View 6 Replies View Related

Sql Cache Invalidation For Sql Server 2005

May 22, 2008

If I simply want a db table to have caching enabled and just care about the application getting that data from the cache instead of physically getting it from the table (no need for me to have a delegate for notification), there is no need for me to create a sqldependency object within my middle tier method associated with my command, correct? I have the sql cache enabled for a particular db table and have the following in my Application_Start event of the global.asox file (SqlDependency.Start “connectionstringâ€?) Once I change something in the table, the cache is invalidated. That’s all I need, correct? 
 

View 3 Replies View Related

SQL Server Hardware Config (cpu Qty Vs Cpu Cache Vs Ram)

May 26, 2000

Which will perform better?
(4) 550Mhz Xeon with 1MB cache and 2GB of RAM
(2) 550Mhz Xeon with 2MB cache and 2GB of RAM
(2) 550Mhz Xeon with 1MB cache and 4GB of RAM

Thanks,
John Fletcher

View 1 Replies View Related

Integration Of SQL Server With Cache DB, Informix

Mar 12, 2008

we r doing some application and SQL server as backend DB Server. this sql server has to be updated continiously 24*7 with data from 3 external sources Cache DB, Iformix and Oracle DB servers. How to handle this in such away that all changes at 3 external sources to be updated to SQL server and this data will use by our application at frondend.
we though of ODBC., but ODBC is very very slow. It should lke Shadowing.
How to handle this?. any help will greatly appreciated.

View 2 Replies View Related

SQL Cache Dependency With Cluster SQL Server && Web Farm

May 30, 2008

I have implemented SQL cache dependency to invalidate cache whenever the result of the stored procedure gets changed. The stored procedure is written obeying all the notification rules.  
Our problem:
As long as we are working on Local machine, Development server or Pre production server its working fine means the cache gets invalidated whenever there is any change in the result set. But the same implementation doesn’t work in Production. Cache does not get invalidated.  
Difference in Production environment and other environment:
Production uses cluster SQL server, others use standard SQL server. Production has load balancing means application is deployed on 6 servers which hits same clustered SQL server. In application’s global.asax file i have Start dependency so I see 6 different notifications started in SQL server which is right. But whenever there is a change in result set the cache doesn’t get invalidated in any of the application. 
My question is
Do we have to follow any different kind of implementation of SQL cache dependency for web farm and cluster SQL server scenario? 
On the same note I would like to add, on the same SQL server I have one more database and a different application is accessing this database. This application is also using SQL cache dependency and its working fine. The only thing this .Net application is NOT deployed on web farm. Its deployed on single application server.  
 

View 2 Replies View Related

Integration Of SQL Server With Cache DB, Informix And Oracle

Mar 12, 2008

SUB: pushing data to SQL server from Informix, Oracle and Cache DB


we r doing some application and SQL server as backend DB Server. this sql server has to be updated continiously 24*7 with data from 3 external sources Cache DB, Iformix and Oracle DB servers. How to handle this in such away that all changes at 3 external sources to be updated to SQL server and this data will use by our application at frondend.
we though of ODBC., but ODBC is very very slow. It should lke Shadowing.
How to handle this?. any help will greatly appreciated.

Thanks in advance.

Prasad
vsrprasad16@gmail.com

View 1 Replies View Related

SQL Server 2008 :: View Log Cache Size

Jun 21, 2010

Can I view the log cache size in SQL Server memory any DMV's which states that.

View 9 Replies View Related

Integration Of SQL Server With Cache DB, Informix And Oracle

Mar 12, 2008



we r doing some application and SQL server as backend DB Server. this sql server has to be updated continiously 24*7 with data from 3 external sources Cache DB, Iformix and Oracle DB servers. How to handle this in such away that all changes at 3 external sources to be updated to SQL server and this data will use by our application at frondend.
we though of ODBC., but ODBC is very very slow. It should lke Shadowing.
How to handle this?. any help will greatly appreciated.

Thanks in advance.

Prasad
vsrprasad16@gmail.com

View 1 Replies View Related

Sql Server 2005 Notification-based Cache Invalidation

Jan 6, 2006

I'm trying to set enable SQL cache invalidation on a webpage, specifically on a a datasource that fills a GridView. 

The website http://beta.asp.net/QUICKSTART/aspnet/doc/caching/SQLInvalidation.aspx makes it sound so very simple, and I have attempted to do all that it says, yet something just isn't right.  The site says that the following needs to be done.

Queries must explicitly include column names in the SELECT statement. Using "SELECT *" results in a query that will not be registered with Sql Server 2005 query notifications.
Table names in queries must include the ownername. For example, if you issue a query against the authors table in the pubs database, the query must reference the table as "dbo.authors".
The security identity running the query must have rights to register queries for notification in Sql Server 2005. This right can be granted with the following T-SQL command: GRANT SUBSCRIBE QUERY NOTIFICATIONS TO username.
The security identity running the query must also have rights to send query notifications from Sql Server 2005. This right can be granted with the following T-SQL command: GRANT SEND ON SERVICE::SqlQueryNotificationService TO username.

I've done items 1,2 & 3, but when I attempt to do item 4 I get the following result in TSql:

Msg 15151, Level 16, State 1, Line 1

Cannot find the service 'SqlQueryNotificationService', because it does not exist or you do not have permission.

My login account has sysadmin priviledges, so I'm guessing the latter part of the error doesn't apply to me.  But what do I have to do to get SqlQueryNoticationService to exist?

 

 

 

View 3 Replies View Related

SQL Server 2008 :: Can Delete Contents Of Update-cache Folder

Sep 26, 2013

this directory is over 2gb

Program FilesMicrosoft SQL Server100Setup BootstrapUpdate Cache

can you delete the contents safely?

View 1 Replies View Related

SQL Server 2012 :: Query Tuning With Each Run Of Fresh / Blank CACHE

Jun 4, 2015

I am using SQL Server 2012 Express.

I am doing performance tuning of SP/Query in Dev-Test environment.

I found that SQL Server caches plan between successive executions.

So if I test/execute SP 10 times, after 1st or 2nd execution, SQL server will pull-up plan-info from CACHE...Not from SQL SERVER Or Database...

Means i am not getting correct answer...

I found this 2 commands:

DBCC FREEPROCCACHE

DBCC DROPCLEANBUFFERS

But they say that executing above command might interfere/bother other people executing other query/sp on this server.

They also say that: Freeing the plan cache causes, for example, a stored procedure to be recompiled instead of reused from the cache. This can cause a sudden, temporary decrease in query performance.

Part of query was using Dynamic-SQL executed with EXEC command.

I replaced that with SP_EXECUTESQL.

How can I start testing of each SP-run with Fresh/Blank CACHE ?

View 1 Replies View Related

SQL Server Admin 2014 :: How To Analyze Large Procedure Cache

Jun 15, 2015

I want to analyze procedure cache, to find inefficient plans and parameter issues.

I do it trow DMV But my requests to DMV are very slow and demand resources because procedure cache is about several GB Actually I dont need on-line analysis.

Is it possible to have fast snapshot of procedure cache?

View 0 Replies View Related

How Can I Check The Notification-based Cache Invalidation With My SQL Server 2005 Really Works?

Mar 31, 2006

I have used the notification-based cache invalidation with my web application, but how can I check it really works? I mena if the backend data didn't change , the data will come from cache not from the database?
 
 <asp:SqlDataSource ID="SqlDataSource_WebInfo" runat="server" ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"                    SelectCommand="SELECT simplified, traditional FROM temp" ProviderName="System.Data.SqlClient" EnableCaching="True" SqlCacheDependency="CommandNotification">
</asp:SqlDataSource>
 
Thanks a lot!

View 1 Replies View Related

SQL Server 2008 :: Identify Size Of Data Cache Allocated From Buffer Pool

Oct 20, 2011

How do i check the size of the datacache allocated from the buffer pool by sql server?

DMV or anything to show me the pool allocation sizes for the various pools in sql server i think i may be able to work from there.

View 9 Replies View Related

Can I Use SQL_Mobile As PC Desktop Server Or PC Local Cache Server?

Jun 14, 2006

Can I use SQL_Mobile as PC desktop server or PC local cache server?

I want many data to be cached at user's PC,
and call for this data to be created transparently as for remote
main SQL server.

Is it possible to do without creating complex structure of doubling functionality
of main queries to single SQL server ?

some articles, samples, links, keywords ?

thanks you

View 1 Replies View Related

SQL Cache Vs Cache

Jul 12, 2006

I read about the SQL 2005 Buffer Cache and the .NET cache.I tried it on about 8000 users query. Both are fast....SQL 2005 being a little faster (probably due to I was sorting the .NET Cache).Any comments?

View 1 Replies View Related

Job Cache

Jul 9, 2002

Hi there,
We have cluster server and we are using sql server 7, everything was working fine on node a and when we move to node b and run the job from the jobs it gives the error message:

Error 22022:SQLServerAgent Error: job ox7bb7d7bf23b8974d8ea8f15e43e854cf
does not exist in the job cache

Can anyone help on this.

Thanks in advance.

Madhu.

View 3 Replies View Related

Cache

Dec 3, 2001

In Sybase, I can bind a database or table to cache, can I do the same
on SQL 7.0?

View 1 Replies View Related

How To Cache ?

Sep 9, 2005

Hi..

I don't know this is possible or not.

for example.. I have a blog site..
my entry links are like that
blog.asp?ID=33
blog.asp?ID=36

36 points "select * tbl where id=36"

And approximately BLOG #36 has 400 views everyday..
content is same.It never change..

Everyday my application performs "select * tbl where id=36"
with direct ASP or Stored Procedure..

Do you have any solution about this ?

How to improve performance..

Just imagine, If entry #36 had 2.000 views everyday ?

just example..

Of course the less perform query, the more performance..

View 1 Replies View Related

Job Cache

Mar 14, 2008

Hello!

When I create new job, I get a message "Job cache 97% full"
What should I do? And what IS a job cache?

Thanks!

Makkaramestari

View 3 Replies View Related

Configuring SQL Cache

Apr 25, 2007

Hi all,
     I have a question regarding SQL caching.
     I want to use SQL caching for my pages.I've gone through http://msdn2.microsoft.com/en-us/library/e3w8402y(VS.80).aspx article on msdn, where in step by step procedure is explained for this. But I have a slightly different situation. In the article, we need to configure our application from web.config by following...
<!-- caching section group --><caching>  <sqlCacheDependency enabled = "true" pollTime = "1000" >    <databases>      <add name="Northwind"          connectionStringName="NorthwindConnectionString1"         pollTime = "1000"      />    </databases>  </sqlCacheDependency></caching>
 
Where in "NorthwindConnectionString1" is the SQLdatasource connection string. But I'm not using SQLDatasource, and have my own classes to build a connection datasource and get a dataset, and then bind it to my control.So in this case what should I write for the above "connectionstring"  attribute. My connection string is in web.config only with a section defined. and in my application i'm reading from web.fing only.The connection section i'm using is as follows...
<ConnSettings>
<add key="ConnString" value="server=serverName;database=dbName;uid=dbuser;Pwd=password"/>
</ConnSettings>
I want to know how to configure my sql cache in this situation.
 
Thanks,
Mehul Mistry

View 2 Replies View Related

Cache Invalidation

May 8, 2007

Hello,
Am wondering if someone can give me a pointer on where to start with a query i have.
What i am trying to do is provide some sort of information to a user that data from a database has been changed. I know that you can cache a page and have output cache directive invalidate it next time it loads if changed but wondering if its poss to be told its changed without reload ( dont see how but never know) - even if not on that page.
What im kinda thinking is something like the popup that outlook has when a new message arrives in in box. Is that just sending a new query? is there a table last modified function in sql? etc.
This is for a web app in c#.
Any help would be appreaciated.
cheers

View 3 Replies View Related

Help With Sql Cache Dependency

May 31, 2007

Hello all.. i'm having a major issue with my Sql Express 2005 database :(
 I'm using wicked code sitemap to allows for a sitemap to be stored in a database.. it uses sql cache dependency to invalidated the cache bla bla
Problem:
After i update a record / add new record the database generates a SqlQueryNotificationStoredProcedure
But it never gets executed. I've done tests on the code it's calling everything accordingly so i'm assuming the problem lies in a configuration setting of the database
done alot of searching around the net and i've found this
GRANT SUBSCRIBE QUERY NOTIFICATIONS TO username
i'm using Windows Authentication how do i run this and will this solve the problem
 
Thank you in advance
Chris

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved