Schema Caching

XML and Internet Support

XML and Internet Support

Schema Caching

Schema caching significantly improves the performance of an XPath query. When an XPath query is executed against an annotated XDR schema, the schema is stored in memory, and the necessary data structures are built in memory. If schema caching is set, the schema remains in memory, thereby improving performance for subsequent XPath queries.

You can set the schema cache size by adding the following key in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\SQLXMLX\SchemaCacheSize.

The schema size is set based on the available memory and the number of schemas you are using. The default SchemaCacheSize size is 31. If you set SchemaCacheSize higher, more memory is used. Therefore, you can increase the cache size if schema access seems slow, or decrease the cache size if memory is low.

For performance reasons, it is recommended that you set SchemaCacheSize higher than the number of mapping schemas you usually use. As the number of schemas increase, if SchemaCacheSize is less than the number of schemas you have, the performance degrades.

Note  During development, it is recommended that you do not cache the schemas, because the changes to the schemas are not reflected in the cache for about two minutes.

See Also

IIS Virtual Directory Management for SQL Server

Using XPath Queries

Accessing SQL Server Using HTTP

XML Error Messages