This will drop all the clean buffers so we will be able to start again from there. Now, run the following script and check the execution plan of the query.Have you ever wondered what types of data are there in your cache?

DataHow

During SQL Server Trainings, I am usually asked if there is any way one can know how much data in a table is stored in the memory cache? The more detailed question I usually get is if there are multiple indexes on table (and used in a query), were the data of the single table stored multiple times in the memory cache or only for a single time?Here is a query you can run to figure out what kind of data is stored in the cache.USE AdventureWorksGOSELECT COUNT (.) AS cachedpagescount,name AS BaseTableName, IndexName,IndexTypeDescFROM sys.dmosbufferdescriptors AS bdINNER JOIN(SELECT sobj.name, sobj.indexid,sobj.allocationunitid, sobj. OBJECTID,i.name IndexName, i.typedesc IndexTypeDescFROM(SELECT OBJECTNAME ( OBJECTID ) AS name,indexid, allocationunitid, OBJECTIDFROM sys.allocationunits AS auINNER JOIN sys.partitions AS pON au.containerid = p.hobtidAND ( au.type = 1 OR au.type = 3 )UNION ALLSELECT OBJECTNAME ( OBJECTID ) AS name,indexid, allocationunitid, OBJECTIDFROM sys.allocationunits AS auINNER JOIN sys.partitions AS pON au.containerid = p.partitionidAND au.type = 2) AS sobjLEFT JOIN sys.indexes i ON i.indexid = sobj.indexidAND i. OBJECTID = sobj. OBJECTID ) AS objON bd.allocationunitid = obj.allocationunitidWHERE databaseid = DBID GROUP BY name, indexid, IndexName, IndexTypeDescORDER BY cachedpagescount DESC;GONow let us run the query above and observe the output of the same. We can see in the above query that there are four columns.CachedPagesCount lists the pages cached in the memory.BaseTableName lists the original base table from which data pages are cached.IndexName lists the name of the index from which pages are cached.IndexTypeDesc lists the type of index.Now, let us do one more experience here.

Cache

Sql Server Clear Cache

Please note that you should not run this test on a production server as it can extremely reduce the performance of the database.DBCC DROPCLEANBUFFERSThis will drop all the clean buffers and we will be able to start again from there. Now run following script and check the execution plan for the same.USE AdventureWorksGOSELECT UnitPrice, ModifiedDateFROM Sales.SalesOrderDetailWHERE SalesOrderDetailID BETWEEN 1 AND 100GOThe execution plans contain the usage of two different indexes.Now, let us run the script that checks the pages cached in SQL Server. It will give us the following output.It is clear from the Resultset that when more than one index is used, datapages related to both or all of the indexes are stored in Memory Cache separately.Let me know what you think of this article. I had a great pleasure while writing this article because I was able to write on this subject, which I like the most. In the next article, we will exactly see what data are cached and those that are not cached, using a few undocumented commands.Reference: Pinal Dave.

Sql Server Buffer Pool Architecture

Pinal Dave is a SQL Server Performance Tuning Expert and an independent consultant. He has authored 11 SQL Server database books, 23 Pluralsight courses and has written over 4700 articles on the database technology on his blog at a Along with 16+ years of hands on experience he holds a Masters of Science degree and a number of database certifications.For any send an email at pinal@sqlauthority.com.Pinal is also a and.Nupur Dave is a social media enthusiast and an independent consultant.

There will be NO refunds. If you want to know more about the condition of each item, ask me questions or ask for more pictures. I am not in control of USPS deliveries. You should NOT expect that used items will be in perfect or new condition! All the items are in used condition, which means they have 'wear and tear'. Cara set remote joker.