Abstract:
A method for providing workload information in a structured workload information data structure format that is organized according to a workload schema to be conducive to a given end usage of the information. The structured workload information can be made accessible using standard database analytical server applications to facilitate ad-hoc querying of the structured workload information to summarize and analyze the database workload or to facilitate exchange of workload information. A structured workload information (SWI) is constructed according to a SWI schema to facilitate a desired end usage of the workload information. The query information is extracted from the workload and stored in a structured workload information (SWI) data structure according to the schema based on the desired end usage of the information such as ad hoc querying or information exchange. The query information may be stored in a relational database having query information organized as a central fact table and a collection of hierarchical dimension tables or as an OLAP cube featuring hierarchical dimensions that arrange the query information in dimensions having objects ordered as a function of granularity or the information may be stored according to an XML schema wherein units of query information are separated by XML tags that identify a type of workload information.

Description:
TECHNICAL FIELD 
   The invention relates general to the field of database systems and more specifically to the field of workload analysis for database systems. 
   BACKGROUND OF THE INVENTION 
   Today&#39;s enterprises are widely deploying commercial relational database systems as back-ends for storing and retrieving large amounts of data. One of the important tasks of a database administrator (DBA) is to ensure that good performance is achieved over time. The ability of a DBA to make informed decisions that impact performance depends heavily on being able to understand the nature of the workload (queries and updates faced by the system). While most commercial relational database systems have tools for logging queries and updates that run against the server, existing aids for summarizing, analyzing, and exchanging the workload within and across organizations are inadequate. In particular, the exchange of workload information is cumbersome due to the lack of a common schema upon which to base the exchange of workload information as well as the complexity of workload information. 
   The ability to efficiently leverage information about the workload of a relational database can assist a DBA in finding under-performing queries, analyzing resource usage, and evaluating the quality of a given query optimizer. To identify an under-performing query, the DBA can search out queries that take a long time to execute and/or spend a significant amount of time scanning the base tables. Or the DBA can identify queries that are I/O intensive and tune the disk layout of the database to better accommodate the identified queries. In addition, a DBA may be interested in detecting users who execute the most queries or identify databases that are accessed most often. The DBA can evaluate the quality of a query optimizer by comparing actual cost to that predicted by the optimizer. Although the workload contains a wealth of information that is useful to a DBA, the exchange of such information is difficult and due to the complexity of existing database workload analysis techniques, most DBAs are limited to performing preprogrammed or “canned” reports on their databases. 
   For example, Paradyn is a performance measurement tool for parallel and distributed programs. It is designed to scale to long running programs (hours or days) and large (thousand node) systems. It can provide performance data down to the procedure or statement level. Paradyn supports dynamic instrumentation and uses a structure search methodology to automate finding performance bottlenecks. While Paradyn can provide meaningful information to the interested DBA, the querying model over the gathered information is technically advanced and not susceptible to ad hoc querying by a relatively unskilled user. Other commercially available performance analysis tools provide canned reports but offer little flexibility to an end user. These tools include PreciseSoft for Oracle, Centerfield and BMC for IBM AS/400, and Platinum for SQL server database systems. 
   SUMMARY OF THE INVENTION 
   Schema can be provided to structure workload information for many purposes such as analysis or information exchange. Providing workload information structured according to the schema in a structured workload information (SWI) format that is accessible using standard data analysis and exchange techniques enhances the usefulness of the workload information. 
   In a relational database system upon which queries are executed and having a workload made up of a series of logged queries and associated query information, a structured workload information (SWI) is constructed that facilitates a desired use of the workload information such as database system analysis or information exchange. The query information is extracted from the workload and stored in the structured workload information (SWI) according to a predetermined schema. Information may be extracted from the workload by accessing a query plan for each query in the workload. 
   According to a feature of one embodiment, the predetermined schema is selected based on an analysis server application that will be used to access the structured workload information (SWI). The predetermined schema may be hierarchical in nature, such that objects in the schema are arranged in dimensions and objects in a dimension are ordered based on a degree of granularity. The query information may be stored in a relational database having query information organized as a central fact table and a collection of hierarchical dimension tables. 
   In one embodiment, the predetermined schema directs that workload data be stored as an OLAP cube featuring hierarchical dimensions that arrange the query information in dimensions having objects ordered as a function of granularity. The cube may have a dimension for at least one of the following query information for each query in the database workload: data objects accessed by the query, a time the query occurred, a user submitting the query, machine on which the query was submitted, a type of query, physical operators included in the query or an associated query plan, or a nature of predicates in the query. 
   In an embodiment directed to facilitating information exchange, the query information includes a plurality of units of information and the query information is stored after appending identifying tags to each of the units of information. The information may be stored according to an XML schema wherein the units of information are separated by XML tags that identify at least one of the following types of workload information: SQL string for the query, query category, a list of tables and columns referenced or updated by the query, total optimizer estimated cost, estimated cardinality of the query, a sequence and logical and physical operators and their arguments used in a query plan. 
   These and other objects, advantages, and features of the invention will be better understood from the accompanying detailed description of preferred embodiments of the invention when reviewed in conjunction with the accompanying drawings. 

   
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The present invention is illustrated by way of example and not limitation in the figures of the accompanying drawings, in which: 
       FIG. 1  illustrates an exemplary operating environment for a system for constructing a structured workload information (SWI); 
       FIG. 2  is a block diagram of a system for constructing a structured workload information (SWI) according to an embodiment of the present invention; 
       FIG. 3  is a block diagram of a schema for storing a workload summary in a relational database according to an embodiment of the present invention; and 
       FIG. 4  is a block diagram of a schema for storing a workload summary in schema corresponding to an OLAP cube according to an embodiment of the present invention. 
   

   DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
   Exemplary Operating Environment 
     FIG. 1  and the following discussion are intended to provide a brief, general description of a suitable computing environment in which the invention may be implemented. Although not required, the invention will be described in the general context of computer-executable instructions, such as program modules, being executed by a personal computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform particular tasks or implement particular abstract data types. Moreover, those skilled in the art will appreciate that the invention may be practiced with other computer system configurations, including hand-held devices, multiprocessor systems, microprocessor-based or programmable consumer electronics, network PCs, minicomputers, mainframe computers, and the like. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote memory storage devices. 
   With reference to  FIG. 1 , an exemplary system for implementing the invention includes a general purpose computing device in the form of a conventional personal computer  20 , including a processing unit  21 , a system memory  22 , and a system bus  24  that couples various system components including system memory  22  to processing unit  21 . System bus  23  may be any of several types of bus structures including a memory bus or memory controller, a peripheral bus, and a local bus using any of a variety of bus architectures. System memory  22  includes read only memory (ROM)  24  and random access memory (RAM)  25 . A basic input/output system (BIOS)  26 , containing the basic routines that help to transfer information between elements within personal computer  20 , such as during start-up, is stored in ROM  24 . Personal computer  20  further includes a hard disk drive  27  for reading from and writing to a hard disk, a magnetic disk drive  28  for reading from or writing to a removable magnetic disk  29  and an optical disk drive  30  for reading from or writing to a removable optical disk  31  such as a CD ROM or other optical media. Hard disk drive  27 , magnetic disk drive  28 , and optical disk drive  30  are connected to system bus  23  by a hard disk drive interface  32 , a magnetic disk drive interface  33 , and an optical drive interface  34 , respectively. The drives and their associated computer-readable media provide nonvolatile storage of computer-readable instructions, data structures, program modules and other data for personal computer  20 . Although the exemplary environment described herein employs a hard disk, a removable magnetic disk  29  and a removable optical disk  31 , it should be appreciated by those skilled in the art that other types of computer-readable media which can store data that is accessible by computer, such as random access memories (RAMs), read only memories (ROMs), and the like may also be used in the exemplary operating environment. 
   A number of program modules may be stored on the hard disk, magnetic disk  129 , optical disk  31 , ROM  24  or RAM  25 , including an operating system  35 , one or more application programs  36 , other program modules  37 , and program data  38 , A database system may also be stored on the hard disk, magnetic disk  29 , optical disk  31 , ROM  24  or RAM  25 . A user may enter commands and information into personal computer  20  through input devices such as a keyboard  40  and pointing device  42 . Other input devices may include a microphone, joystick, game pad, satellite dish, scanner, or the like. These and other input devices are often connected to processing unit  21  through a serial port interface  46  that is coupled to system bus  23 , but may be connected by other interfaces, such as a parallel port, game port or a universal serial bus (USB). A monitor  47  or other type of display device is also connected to system bus  23  via an interface, such as a video adapter  48 . In addition to the monitor, personal computers typically include other peripheral output devices such as speakers and printers. 
   Personal computer  20  may operate in a networked environment using logical connections to one or more remote computers, such as a remote computer  49 . Remote computer  49  may be another personal computer, a server, a router, a network PC, a peer device or other common network node, and typically includes many or all of the elements described above relative to personal computer  20 , although only a memory storage device  50  has been illustrated in  FIG. 1 . The logical connections depicted in  FIG. 1  include local area network (LAN)  51  and a wide area network (WAN)  52 . Such networking environments are commonplace in offices, enterprise-wide computer networks, intranets, and the Internet. 
   When using a LAN networking environment, personal computer  20  is connected to local network  51  through a network interface or adapter  53 . When used in a WAN networking environment, personal computer  20  typically includes a modem  54  or other means for establishing communication over wide area network  52 , such as the Internet. Modem  54 , which may be internal or external, is connected to system bus  23  via serial port interface  46 . In a networked environment, program modules depicted relative to personal computer  20 , or portions thereof, may be stored in remote memory storage device  50 . It will be appreciated that the network connections shown are exemplary and other means of establishing a communications link between the computers may be used. 
   Structured Workload Information (SWI) 
   Referring now to  FIG. 2 , an architectural overview of a method  200  for constructing a structured workload information (SWI)  222  data structure according to a SWI schema  230  is shown. The method  200  may be stored as part of an application program  36  ( FIG. 1 ). The SWI schema is built according to the use that will be made of the SWI. For example, one SWI schema imposes a structure on the workload information that makes it conducive to analysis and ad hoc querying, while another SWI schema imposes a structure that facilitates exchange of the workload information. 
   To construct the structured workload information, a workload  201  in the form of a file or table containing a sequence of SQL queries and updates is input to a structured workload information engine  210 . The workload information engine  210  is specifically adapted according to the SWI schema that is input to the structured workload information engine  210 . The workload that is input to the structured workload information engine  210  can be obtained using the event logging capabilities of modern commercial database systems such as the Profiler in Microsoft SQL Server. The structured workload information engine  210  produces as output the structured workload information (SWI)  222  that is organized according to the SWI schema  230 . For the purposes of this description, the SWI schema  230  is an OLAP or XML schema, however, any schema that can be used to transform the workload information into a data structure that is useful to an end user is contemplated by the present invention. 
   In an exemplary embodiment, the structured workload information (SWI)  222  is a data cube that is structured in a hierarchical fashion by the SWI schema and stored in an OLAP database using Microsoft Analysis Server. The data cube contains information about the given workload, organized in a multidimensional format that makes it easy to summarize and analyze the workload in different ways. For example, the standard cube browsing and querying tools that accompany Microsoft Analysis Server to summarize and analyze the workload can be used. In another exemplary embodiment, the SWI schema structures the workload with XML tags so that the SWI is easily exchanged between remote computers. 
   The structured workload information engine  210  consists of two components and a third optional component. A workload information extractor  212  extracts relevant information from the workload (also called a “trace”). What information is “relevant” is determined by the intended use of the structured workload information (SWI). Three potential uses for the structered workload information are 1) performance analysis of queries, updates; 2) resource usage; and 3) query optimizer quality. The OLAP cube schema is designed to support these tasks, and information from the trace that is required to build the OLAP cube is extracted by the workload information extractor  212 . In general, the workload may contain information that is not relevant for the desired tasks, and furthermore, the required information may not be readily available in the desired form. For example, in a trace file obtained from Microsoft SQL Server Profiler, each event in the trace file contains several fields EventClass, TextData, Application Name, HostName, NTUserName, LoginName, CPU, Reads, Writes, Duration, . . . ). Therefore, it is important that the workload information extractor  212  efficiently extracts the relevant information from the workload. 
   The workload information extractor  212  reads events from the workload one at a time and stores necessary data in files  225  to be used by the structured workload information engine  210 . For each event, the extractor extracts information about the user issuing the query, the machine from which the event was generated, the duration of the event (.i.e., the time taken to execute the query) and the time at which the event occurred, directly from fields in the event. However, all other relevant information about the event (e.g., the type of the statement, which tables were referenced in the query/update, the query optimizer&#39;s estimate of the execution time of the query etc.) is not directly available from the trace file. The workload information extractor  212  extracts this information by examining the plan of the query in the event (the actual query string is available in the TextData field of the event). The plan of a query, which is determined by the query optimizer component of the database server, is the sequence of steps (called operators) taken by the database server to actually execute the query. The ability to obtain the plan of a query without actually executing it is a standard feature in today&#39;s relational database systems, and is important since it makes it possible for the structured workload information engine  210  to efficiently extract the required information. 
   In Microsoft SQL Server, the Showplan interface provides the ability to obtain the plan of a query. Along with each operator in the plan, Showplan provides additional information such as the estimated cost of executing the operator, the estimated cost of executing the sub-tree at the operator, the type of the operator (e.g., Table Scan, Index Scan, Merge Join, Sort, etc. . . ), the estimated number and size of the rows passing through each operator, etc. By examining the plan, the workload information extractor  212  extracts the required information (e.g. which tables are referenced, the type of join method used, the total estimated cost of the query, etc. . . ). The extractor  212  is efficient because for each event in the workload, it needs to invoke the Showplan interface only once, and never executes any queries. The information extracted in this step is saved into files, so that subsequent modules can process it later. if the kinds of analysis supported by the structured workload information  222  needs to be augmented such as by adding a new dimension in the OLAP schema, the extractor  212  needs to be augmented to extract the necessary additional information. 
   An optional component in the structured workload information engine  210  is a database loader  214 . The database loader loads the information extracted by the workload information extractor  212  into a relational database  55  with a generic (pre-defined) schema. Loading the information into a relational database enables a sophisticated user to directly query this information and obtain advanced analysis that may not be possible with a more restrictive model such as OLAP or XML. In addition, other structured workload information (SWI) data structures may leverage the relational database schema. 
   One example of a schema  300  that can be used for storing workload information in a relational database is shown in  FIG. 3 . The schema of the relational database created by the database loader  214  ( FIG. 2 ) is a schema required for multidimensional analysis, and is organized as a central fact table and a collection of hierarchical dimension tables.  FIG. 3  shows the schema of tables for modeling the “Data Objects” dimension hierarchy consisting of the database object  310 , the table object  320 , the column object  330 , and the index object  340 ,  350 . An index is defined over a sequence of columns of a table and therefore the information about the index is stored in normalized form in two separate tables  340 ,  350 . 
   Referring back to  FIG. 2 , a SWI populator  216  is employed to create a structured workload information (SWI)  222  for access by an analysis server  220 . In this described embodiment, the structured workload information (SWI)  222  is an OLAP cube stored in an OLAP database on the analysis server. The data for populating the cube either comes from the files created by the workload information extractor  212  or the relational database  55  (if the database loader  214  is used). The structured workload information (SWI) populator  216  uses standard OLE-DB interfaces to create and populate the cube, can therefore be used against any OLAP server (i.e., it is not restricted to Microsoft Analysis Server). Once the cube has been built, the user can leverage client tools that ship with the standard analysis server, such as a cube browser, to view and query the cube. Users may also employ other more sophisticated analysis tools such as data mining tools that also accompany the analysis server. For example, a DBA can build a decision tree over the OLAP cube to model expensive queries. 
   By default, the structured workload information  222  includes several dimensions in the data cube created by the structured workload information engine  210 . Each dimension is organized in a hierarchy to allow drill-down from coarse-grained analysis to progressively more fine-grained analysis.  FIG. 4  depicts several dimensions that might be featured as default dimensions in an OLAP schema  400  for storing workload data as an OLAP cube. 
   In the OLAP cube, a dimension for data objects  410  consists of databases, tables, columns, and indexes and allows analysis of the workload with respect to a specified set of objects. For example, this dimension allows analyzing the average execution time of all queries that reference a given table T. A time dimension  420  consists of year, month, day, hour minute, second, and millisecond. This dimension allows temporal analysis. For example, this dimension provides an answer to a question about the number of queries that executed in a given interval of time. A user dimension  440  consisting of user and user group provides information such as a breakdown of how many times the user referenced each database. A machine dimension consists of machine cluster and machine. This dimension allows analysis of measures on a cluster of machines or single machine. 
   Other single level dimensions not shown mavalso be provided in the OLAP cube. A query type dimension can contain values such as SELECT, INSERT, UPDATE, and DELETE. A physical operator dimension allows the user to analyze the workload based on the execution plans of the queries and can contain the value of any physical operator that can appear in an execution plan. For example, this dimension can be used to analyze how often a Mergejoin operator was used vs. a HashJoin operator. Such information can be valuable to designers of a database system. A predicates dimension allows categorization of queries by the nature of the predicates in the queries. For example, the information in this dimension provides answers to questions such as: “How many queries in the workload contained equality selection predicates on table?” and “What is the average execution time of all queries that contained one or more join predicates?” 
   The dimensional hierarchies can be used to drill down or up to obtain finer or coarser granularity of analysis as desired. For example, the most frequently referenced table in the database can be found and then by drilling down, the most frequently referenced column of the table can then be found. Also, since OLAP supports multi-dimensional analysis, the data can be analyzed by two or more dimensions simultaneously. For example, for each database (dimension (a)), the workload can be analyzed by each query type (dimension (e)). Also, the addition of new dimensions or removal of existing dimensions is permitted by the flexible OLAP model. 
   Measures that are automatically defined in the OLAP cube are 1) the number (count) of statements, 2) the total execution time of each statement, 3) the total CPU time of each statement, 4) the total I/O time of each statement, 5) the optimizer estimated time of each statement, and 6) the number of tables referenced. The model can be extended to include additional measures by adding them during the building of the cube. 
   In another embodiment, the SWI populator  216  creates a structured workload information (SWI)  222  according to a SWI schema  230  presented as an .xsd file to produce a SWI that is an .xml file. A structured workload information (SWI) according to this embodiment facilitates the exchange of the workload information across a corporate intranet or the Internet, shown generally as  226 . The workload information can be transferred in this format from one computer for analysis by a remotely located analysis server  220 . The SWI populator  216  utilizes an XML schema that describes the workload analysis information that is likely to be useful for the exchange of this information. 
   The content of the XML schema can be broadly classified as: (a) information obtained from syntactic analysis of a workload event; (b) information obtained from the execution plan generated by the query optimizer; and (c) information obtained during execution of the query. For the purposes of this description, the schema is defined in a file called WorkloadAnalysis.xsd, the contents of which follow as Table 1: 
   
     
       
             
           
             
             
           
             
           
             
             
           
             
           
             
             
           
             
           
             
             
           
             
             
           
             
             
           
             
           
             
             
           
             
           
             
             
           
             
           
             
             
           
             
           
             
             
           
             
           
             
             
           
             
             
           
             
             
           
             
           
             
             
           
             
           
             
             
           
             
             
           
             
           
         
             
               TABLE 1 
             
             
                 
             
           
           
             
               &lt;?xml version=“1.0” encoding=“utf-8” ?&gt; 
             
             
               &lt;xs:schema xmlns:xs=“http://www.w3.org/2001/XMLSchema”&gt; 
             
             
                &lt;xs:annotation&gt; 
             
             
                 &lt;xs:appinfo&gt;XML Schema for Workload Analysis&lt;/xs:appinfo&gt; 
             
             
                 &lt;xs:documentation&gt; 
             
             
               This schema describes a specification for interchange of workload analysis data. 
             
             
               In the current design, a workload is assumed to be a sequence of SQL statements. 
             
             
                 &lt;/xs:documentation&gt; 
             
             
                &lt;/xs:annotation&gt; 
             
             
                &lt;!-- 
             
             
               ************************************************************************ 
             
             
                ** Root element of the schema. 
             
             
                ** This schema can be extended by extending the Statement type 
             
             
               ************************************************************************ 
             
             
                --&gt; 
             
             
                &lt;xs:element name=“WorkloadAnalysisXML”&gt; 
             
             
                 &lt;xs:complexType&gt; 
             
             
                  &lt;xs:sequence&gt; 
             
             
                   &lt;xs:element name=“Event” type=“EventType” minOccurs=“0” /&gt; 
             
             
                  &lt;/xs:sequence&gt; 
             
             
                 &lt;xs:complexType&gt; 
             
             
                &lt;/xs:element&gt; 
             
             
                &lt;!-- 
             
             
               ************************************************************************ 
             
             
                ** Event and Statement Types. An event consists of a batch 
             
             
                ** (i.e., sequence) of statements. 
             
             
               ************************************************************************ 
             
             
                --&gt; 
             
             
                &lt;xs:complexType name=“EventType” &gt; 
             
             
                 &lt;xs:sequence&gt; 
             
             
                  &lt;xs:element name=“Statement” type=“StatementType” minOccurs=“1” /&gt; 
             
             
                 &lt;/xs:sequence&gt; 
             
             
                &lt;/xs:complexType&gt; 
             
             
                &lt;xs:complexType name=“StatementType”&gt; 
             
             
                 &lt;xs:annotation&gt; 
             
             
                  &lt;xs:documentation&gt; 
             
             
               A statement type represents pertinent information about a SQL statement that can be used 
             
             
               for a variety of analysis. 
             
           
        
         
             
                 
               The information present here can be extended by adding more details that 
             
             
                 
               may be useful for other kinds of analysis. Currently, the information 
             
             
                 
               associated with a statement can be categorized as: 
             
             
                 
               (a) syntactic analysis of statement, i.e., parsing 
             
             
                 
               (b) plan information obtained by optimizing the statement, and 
             
             
                 
               (c) information gathered during execution of the statement. 
             
             
                 
               Syntactic (structural) information about statement: 
             
             
                 
               (1) SQL String for statement 
             
             
                 
               (2) Statement category: SELECT, INSERT, UPDATE, DELETE, OTHER (all 
             
           
        
         
             
               others) 
             
           
        
         
             
                 
               (3) List of tables, columns referenced/updated in statement 
             
             
                 
               (4) List of Projection columns 
             
             
                 
               (5) List of Group By columns 
             
             
                 
               (6) List of Order By columns 
             
             
                 
               (7) List of predicates trees consiting of AND/OR/NOT of atomic join and 
             
           
        
         
             
               selection conditions 
             
           
        
         
             
                 
               Plan information for the statement: 
             
             
                 
               1. Total optimizer estimated cost of executing the statement. 
             
             
                 
               2. Estimated cardinality of ouptut of statement. 
             
             
                 
               3. Sequence of logical and physical operators and their arguments used in the 
             
           
        
         
             
               plan. 
             
           
        
         
             
                 
               Execution Information for the statement: 
             
             
                 
               1. Actual cost of executing the statement. 
             
             
                 
               2. Actual cardinality of ouptut of statement. 
             
             
                 
               &lt;/xs:documentation&gt; 
             
           
        
         
             
                 
               &lt;/xs:annotation&gt; 
             
             
                 
               &lt;xs:sequence&gt; 
             
           
        
         
             
                 
               &lt;!-- User Name submitting the statement --&gt; 
             
             
                 
               &lt;xs:element name=“User” type=“UserType” minOccurs=“0” /&gt; 
             
             
                 
               &lt;!-- Machine Name on which statement was submitted --&gt; 
             
             
                 
               &lt;xs:element name=“Machine” type=“MachineType” minOccurs=“0” /&gt; 
             
             
                 
               &lt;!-- Timestamp at which statement was submitted --&gt; 
             
             
                 
               &lt;xs:element name=“StartTime” type=“xs:dateTime” minOccurs=“0” /&gt; 
             
             
                 
               &lt;!-- Is Statement part of batch/stored procedure? --&gt; 
             
             
                 
               &lt;xs:element name=“IsPartOfBatch” type=“BooleanType” default=“0” 
             
           
        
         
             
               minOccurs=“0”/&gt; 
             
           
        
         
             
                 
               &lt;xs:element name=“IsPartOfStoredProcedure” type=“BooleanType” 
             
           
        
         
             
               default=“0” minOccurs=“0”/&gt; 
             
           
        
         
             
                 
               &lt;!-- Tables/Columns Referenced or Updated in statement --&gt; 
             
             
                 
               &lt;xs:element name=“ReferencedTable” type=“TableType” minOccurs=“0” /&gt; 
             
             
                 
               &lt;xs:element name=“UpdatedTable” type=“TableType” minOccurs=“0” /&gt; 
             
             
                 
               &lt;xs:element name=“ReferencedColumn” type=“ColumnType” 
             
           
        
         
             
               minOccurs=“0” /&gt; 
             
           
        
         
             
                 
               &lt;xs:element name=“UpdatedColumn”type=“ColumnType”minOccurs=“0” /&gt; 
             
             
                 
               &lt;xs:element name=“ProjectionColumn”type=“ColumnType”minOccurs=“0” 
             
           
        
         
             
               /&gt; 
             
           
        
         
             
                 
               &lt;xs:element name=“GroupByColumn”type=“ColumnType”minOccurs=“0” /&gt; 
             
             
                 
               &lt;xs:element name=“OrderByColumn”type=“ColumnType”minOccurs=“0” /&gt; 
             
             
                 
               &lt;!-- Predicates (join/selection) in statement --&gt; 
             
             
                 
               &lt;xs:element name=“PredicateTree”type=“PredicateTreeType”minOccurs=“0” 
             
           
        
         
             
               /&gt; 
             
           
        
         
             
                 
               &lt;!-- Operators used in plan for statement --&gt; 
             
             
                 
               &lt;xs:element name=“Operator” type=“OperatorType” minOccurs=“0”/&gt; 
             
           
        
         
             
                 
               &lt;/xs:sequence&gt; 
             
             
                 
               &lt;!-- SQL String for statement --&gt; 
             
             
                 
               &lt;xs:attribute name=“StatementString” type=“xs:string”/&gt; 
             
             
                 
               &lt;!-- Type of statement SELECT, INSERT, UPDATE, DELETE, OTHER --&gt; 
             
             
                 
               &lt;xs:attribute name=“StatementCategory” type=“EnumStatementCategory” /&gt; 
             
             
                 
               &lt;!-- Optimizer vs. Execution information --&gt; 
             
             
                 
               &lt;xs:attribute name=“OptimizerEstimatedCostInMS” type=“xs:float”/&gt; 
             
             
                 
               &lt;xs:attribute name=“OptimizerEstimatedCardinality” type=“xs:unsignedLong”/&gt; 
             
             
                 
               &lt;xs:attribute name=“ActualExecutionCostInMS” type=“xs:float”/&gt; 
             
             
                 
               &lt;xs:attribute name=“ActualCardinality” type=“xs:unsignedLong”/&gt; 
             
           
        
         
             
                 
               &lt;/xs:complexType&gt; 
             
             
                 
               &lt;!-- 
             
           
        
         
             
               ************************************************************************ 
             
             
                ** User and Machine Types 
             
             
               ************************************************************************ 
             
             
                --&gt; 
             
             
                &lt;xs:complexType name=“UserType”&gt; 
             
             
                 &lt;xs:sequence&gt; 
             
             
                  &lt;xs:element name=“UserName” type=“NameType” minOccurs=“1” /&gt; 
             
             
                  &lt;xs:element name=“UserGroupName” type=“NameType” minOccurs=“0” /&gt; 
             
             
                 &lt;/xs:sequence&gt; 
             
             
                &lt;/xs:complexType&gt; 
             
             
                &lt;xs:complexType name=“MachineType”&gt; 
             
             
                 &lt;xs:sequence&gt; 
             
             
                  &lt;xs:element name=“MachineName” type=“NameType” minOccurs=“1” /&gt; 
             
             
                  &lt;xs:element name=“MachineIPAddress” type=“xs:string” minOccurs=“0” /&gt; 
             
             
                  &lt;xs:element name=“MachineSubnetMask”type=“xs:string” minOccurs=“0” /&gt; 
             
             
                  &lt;xs:element name=“MachineGateway” type=“xs:string” minOccurs=“0” /&gt; 
             
             
                 &lt;/xs:sequence&gt; 
             
             
                &lt;/xs:complexType&gt; 
             
             
                &lt;!-- 
             
             
               ************************************************************************ 
             
             
                ** Predicate information 
             
             
               ************************************************************************ 
             
             
                --&gt; 
             
             
                &lt;xs:complexType name=“PredicateTreeType”&gt; 
             
             
                 &lt;xs:sequence&gt; 
             
             
                  &lt;xs:element name=“LogicalOp” type=“LogicalOpType” minOccurs=“0” 
             
             
               maxOccurs=“1”/&gt; 
             
             
                  &lt;xs:choice&gt; 
             
             
                  &lt;xs:element name=“PredicateTree” type=“PredicateTreeType” 
             
             
               minOccurs=“1” maxOccurs=“2” /&gt; 
             
             
                  &lt;xs:element name=“Predicate” type=“PredicateType” minOccurs=“1” 
             
             
               maxOccurs=“2” /&gt; 
             
             
                  &lt;/xs:choice&gt; 
             
             
                 &lt;/xs:sequence&gt; 
             
             
                &lt;/xs:complexType&gt; 
             
             
                &lt;xs:complexType name=“PredicateType”&gt; 
             
             
                 &lt;xs:sequence&gt; 
             
             
                  &lt;xs:element name=“LeftHandSize” type=“ValRefType” minOccurs=“1” 
             
             
               maxOccurs=“1”/&gt; 
             
             
                  &lt;xs:element name=“ComparisonOperator” type=“ComparisonOperatorType” 
             
             
               minOccurs=“1” maxOccurs=“1”/&gt; 
             
             
                  &lt;xs:element name=“RightHandSize” type=“ValRefType” minOccurs=“1” 
             
             
               maxOccurs=“1”/&gt; 
             
             
                 &lt;/xs:sequence&gt; 
             
             
                &lt;/xs:complexType&gt; 
             
             
                &lt;xs:complexType name=“ValRefType”&gt; 
             
             
                 &lt;xs:choice&gt; 
             
             
                  &lt;xs:element name=“ColumnReference” type=“ColumnType” minOccurs=“1” 
             
             
               maxOccurs=“1”/&gt; 
             
             
                  &lt;xs:element name=“Constant” type=“ConstantType” minOccurs=“1” 
             
             
               maxOccurs=“1”/&gt; 
             
             
                 &lt;/xs:choice&gt; 
             
             
                &lt;/xs:complexType&gt; 
             
             
                &lt;xs:complexType name=“ConstantType”&gt; 
             
             
                 &lt;xs:attribute name=“Value” type=“xs:string” /&gt; 
             
             
                &lt;/xs:complexType&gt; 
             
             
                &lt;xs:simpleType name=“LogicalOpType”&gt; 
             
             
                 &lt;xs:restriction base=“xs:string”&gt; 
             
             
                  &lt;xs:enumeration value=“AND” /&gt; 
             
             
                  &lt;xs:enumeration value=“OR” /&gt; 
             
             
                  &lt;xs:enumeration value=“NOT” /&gt; 
             
             
                 &lt;/xs:restriction&gt; 
             
             
                &lt;/xs:simpleType&gt; 
             
             
                &lt;xs:simpleType name=“ComparisonOperatorType”&gt; 
             
             
                 &lt;xs:restriction base=“xs:string”&gt; 
             
             
                  &lt;xs:enumeration value=“EQ” /&gt; 
             
             
                  &lt;xs:enumeration value=“LE” /&gt; 
             
             
                  &lt;xs:enumeration value=“LT” /&gt; 
             
             
                  &lt;xs:enumeration value=“GE” /&gt; 
             
             
                  &lt;xs:enumeration value=“GT” /&gt; 
             
             
                  &lt;xs:enumeration value=“NE” /&gt; 
             
             
                 &lt;/xs:restriction&gt; 
             
             
                &lt;/xs:simpleType&gt; 
             
             
                &lt;!-- 
             
             
               ************************************************************************ 
             
             
                ** Logical and Physical Operators that can appear in a plan. Note that the 
             
             
                ** terminology used is what is currently employed in Microsoft SQL Server 
             
             
                ** Showplan output. It is possible to extend the set of operators to those 
             
             
                ** that are specific to other Database Management Systems. 
             
             
               ************************************************************************ 
             
             
                --&gt; 
             
             
                &lt;xs:complexType name=“OperatorType”&gt; 
             
             
                 &lt;xs:sequence&gt; 
             
             
                  &lt;xs:element name=“LogicalOperator” type=“LogicalOperatorType” 
             
             
               minOccurs=“1” maxOccurs=“1”/&gt; 
             
             
                  &lt;xs:element name=“PhysicalOperator” type=“PhysicalOperatorType” 
             
             
               minOccurs=“1” maxOccurs=“1”/&gt; 
             
             
                 &lt;/xs:sequence&gt; 
             
             
                &lt;/xs:complexType&gt; 
             
             
                &lt;xs:simpleType name=“LogicalOperatorType”&gt; 
             
             
                 &lt;xs:restriction base=“xs:string”&gt; 
             
           
        
         
             
                 
               &lt;xs:enumeration value=“Collapse” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Concatenation” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Constant Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Delay” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Broadcast” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Gather Streams” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Repartition Streams” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Distribute Streams” /&gt; 
             
             
                 
               &lt;xs:enumeration va1ue=“Segment Repartition” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Branch Repartition” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Filter” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Assert” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“LogRowScan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Print” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Compute Scalar” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Merge Interval” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Rank” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Segment” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Sequence” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Split” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Aggregate” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Table Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Clustered Index Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Clustered Index Seek” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Deleted Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Inserted Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Parameter Table Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Index Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Index Seek” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Remote Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Remote Query” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Remote Insert” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Remote Update” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Remote Delete” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Clustered Update” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Distinct Sort” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Sort” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“TopN Sort” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Eager Spool” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Lazy Spool” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Update ” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Insert” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Delete” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Workfile Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Top” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Distinct” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Flow Distinct” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Cache” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Partial Aggregate” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“InnerJoin” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Left Outer Join” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Right Outer Join” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Full Outer Join” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Left Semi Join” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Left Anti Sem iJoin ” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Right Semi Join” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Right Anti Semi Join” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Intersect” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Intersect All” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Union” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Left Diff” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Left Diff All” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Right Diff” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Right Diff All” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Anti Diff” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Cross Join” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Bitmap Create” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“UDX” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Switch” /&gt; 
             
           
        
         
             
                 &lt;/xs:restriction&gt; 
             
             
                &lt;/xs:simpleType&gt; 
             
             
                &lt;xs:simpleType name=“PhysicalOperatorType”&gt; 
             
             
                 &lt;xs:restriction base=“xs string”&gt; 
             
           
        
         
             
                 
               &lt;xs:enumeration value=“Collapse” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Concatenation” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Constant Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Delay” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Parallelism” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Filter” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Assert” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Hash Match” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Log Row Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Merge Join” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Nested Loops” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Print” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Compute Scalar” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Merge Interval” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Rank” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Row Count Spool” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Segment” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Sequence” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Split” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Stream Aggregate” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Table Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Clustered Index Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Clustered Index Seek” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Deleted Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Inserted Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Parameter Table Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Index Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Index Seek” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Remote Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Remote Query” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Remote Insert” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Remote Update” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Remote Delete” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Clustered Update” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Sort” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Table Spool” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Index Spool” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Table Update” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Table Insert” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Table Delete” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Index Update” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Index Insert” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Index Delete” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Clustered Index Update” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Clustered Index Insert” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Clustered Index Delete” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Workfile Scan” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Top” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Bitmap” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“UDX” /&gt; 
             
             
                 
               &lt;xs:enumeration value=“Switch” /&gt; 
             
           
        
         
             
                 
               &lt;/xs:restriction&gt; 
             
           
        
         
             
                &lt;/xs:simpleType&gt; 
             
             
                &lt;xs:simpleType name=“LogicalOperatorEnumType”&gt; 
             
             
                 &lt;xs:restriction base=“xs:string”&gt; 
             
             
                  &lt;xs:enumeration value=“” /&gt; 
             
             
                  &lt;xs:enumeration value=“” /&gt; 
             
             
                 &lt;/xs:restriction&gt; 
             
             
                &lt;/xs:simpleType&gt; 
             
             
                &lt;!-- 
             
             
               ************************************************************************ 
             
             
                ** Object Types. Following objects are defined below. 
             
             
                ** Server, Database, Table, Column, Index, Materialized view, Stored Procedure 
             
             
               ************************************************************************ 
             
             
                --&gt; 
             
             
                &lt;xs:complexType name=“ServerType”&gt; 
             
             
                 &lt;xs:sequence&gt; 
             
             
                  &lt;xs:element name=“Name” type=“NameType” /&gt; 
             
             
                 &lt;/xs:sequence&gt; 
             
             
                &lt;/xs:complexType&gt; 
             
             
                &lt;xs:complexType name=“DatabaseType”&gt; 
             
             
                 &lt;xs:sequence&gt; 
             
             
                  &lt;xs:element name=“Name” type=“NameType” /&gt; 
             
             
                  &lt;xs:element name=“Server” type=“ServerType” minOccurs=“0” /&gt; 
             
             
                 &lt;/xs:sequence&gt; 
             
             
                &lt;/xs:complexType&gt; 
             
             
                &lt;xs:complexType name=“OwnerType”&gt; 
             
             
                 &lt;xs:sequence&gt; 
             
             
                  &lt;xs:element name=“Name” type=“NameType” /&gt; 
             
             
                  &lt;xs:element name=“Server” type=“ServerType” minOccurs=“0” /&gt; 
             
             
                  &lt;xs:element name=“Database” type=“DatabaseType” minOccurs=“0” /&gt; 
             
             
                 &lt;/xs:sequence&gt; 
             
             
                &lt;/xs:complexType&gt; 
             
             
                &lt;xs:complexType name=“TableType”&gt; 
             
             
                 &lt;xs:sequence&gt; 
             
             
                  &lt;xs:element name=“Name” type=“NameType” /&gt; 
             
             
                  &lt;xs:element name=“Server” type=“ServerType” minOccurs=“0” /&gt; 
             
             
                  &lt;xs:element name=“Database” type=“DatabaseType” minOccurs=“0” /&gt; 
             
             
                  &lt;xs:element name=“Owner” type=“DatabaseType” minOccurs=“0” /&gt; 
             
             
                 &lt;/xs:sequence&gt; 
             
             
                 &lt;xs:attribute name=“NumRows” type=“xs:unsignedLong” /&gt; 
             
             
                &lt;/xs:complexType&gt; 
             
             
                &lt;xs:complexType name=“ViewType”&gt; 
             
             
                 &lt;xs:sequence&gt; 
             
             
                  &lt;xs:element name=“Name” type=“NameType” /&gt; 
             
             
                  &lt;xs:element name=“Server” type=“ServerType” minOccurs=“0” /&gt; 
             
             
                  &lt;xs:element name=“Database” type=“DatabaseType” minOccurs=“0” /&gt; 
             
             
                  &lt;xs:element name=“Owner” type=“DatabaseType” minOccurs=“0” /&gt; 
             
             
                 &lt;/xs:sequence&gt; 
             
             
                 &lt;xs:attribute name=“ViewDefinition” type=“xs:string” /&gt; 
             
             
                &lt;/xs:complexType&gt; 
             
             
                &lt;xs:complexType name=“ColumnType”&gt; 
             
             
                 &lt;xs:sequence&gt; 
             
             
                  &lt;xs:element name=“Name” type=“NameType” /&gt; 
             
             
                  &lt;xs:element name=“Server” type=“ ServerType” minOccurs=“0” /&gt; 
             
             
                  &lt;xs:element name=“Database” type=“DatabaseType” minOccurs=“0” /&gt; 
             
             
                  &lt;xs:element name=“Owner” type=“DatabaseType” minOccurs=“0” /&gt; 
             
             
                  &lt;xs:element name=“Table” type=“TableType” minOccurs=“0” /&gt; 
             
             
                 &lt;/xs:sequence&gt; 
             
             
                 &lt;xs:attribute name=“DataType” type=“xs:string” default=“int”/&gt; 
             
             
                 &lt;xs:attribute name=“Collation” type=“EnumCollationType” default=“ASC” /&gt; 
             
             
                 &lt;xs:attribute name=“IsIndexKey” type=“IsIndexKeyType” default=“no” /&gt; 
             
             
                &lt;xs:complexType&gt; 
             
             
                &lt;xs:complexType name=“IndexType”&gt; 
             
             
                 &lt;xs:sequence&gt; 
             
             
                  &lt;xs:element name=“Name” type=“NameType” /&gt; 
             
             
                  &lt;xs:element name=“Name” type=“NameType” /&gt; 
             
             
                  &lt;xs:element name=“Server” type=“ServerType” minOccurs=“0” /&gt; 
             
             
                  &lt;xs:element name=“Database” type=“DatabaseType” minOccurs=“0” /&gt; 
             
             
                  &lt;xs:element name=“Owner” type=“DatabaseType” minOccurs=“0” /&gt; 
             
             
                  &lt;xs:choice&gt; 
             
             
                   &lt;xs:element name=“Table” type=“TableType” minOccurs=“0” /&gt; 
             
             
                   &lt;xs:element name=“View” type=“ViewType” minOccurs=“0” /&gt; 
             
             
                  &lt;/xs:choice&gt; 
             
             
                  &lt;xs:element name=“Column” type=“ColumnType” minOccurs=“1” /&gt; 
             
             
                 &lt;/xs:sequence&gt; 
             
             
                 &lt;xs:attribute name=“ClusteringProperty” type=“ClusteringPropertyType” 
             
             
               default=“Non Clustered” /&gt; 
             
             
                 &lt;xs:attribute name=“UniquenessProperty” type=“UniquenessPropertyType” 
             
             
               default=“Non Unique” /&gt; 
             
             
                &lt;/xs:complexType&gt; 
             
             
                &lt;!-- 
             
             
                ***************************************** 
             
             
                ** Boolean type 
             
             
                ***************************************** 
             
             
                --&gt; 
             
             
                &lt;xs:simpleType name=“BooleanType”&gt; 
             
             
                 &lt;xs:restriction base=“xs:unsignedInt”&gt; 
             
             
                  &lt;xs:minInclusive value=“0” /&gt; 
             
             
                  &lt;xs:maxInclusive value=“1” /&gt; 
             
             
                 &lt;/xs:restriction&gt; 
             
             
                &lt;/xs:simpleType&gt; 
             
             
                &lt;!— 
             
             
               ***************************************** 
             
             
               ** Simple Types 
             
             
               ***************************************** 
             
             
                --&gt; 
             
             
                &lt;xs:simpleType name=“EnumStatementCategory”&gt; 
             
             
                 &lt;xs:restriction base=“xs:string”&gt; 
             
             
                  &lt;xs:enumeration value=“SELECT” /&gt; 
             
             
                  &lt;xs:enumeration value=“UPDATE” /&gt; 
             
             
                  &lt;xs:enumeration value=“INSERT” /&gt; 
             
             
                  &lt;xs:enumeration value=“DELETE” /&gt; 
             
             
                 &lt;/xs:restriction&gt; 
             
             
                &lt;/xs:simpleType&gt; 
             
             
                &lt;xs:simpleType name=“EnumCollationType”&gt; 
             
             
                 &lt;xs:restriction base=“xs:string”&gt; 
             
             
                  &lt;xs:enumeration value=“ASC” /&gt; 
             
             
                  &lt;xs:enumeration value=“DESC” /&gt; 
             
             
                 &lt;/xs:restriction&gt; 
             
             
                &lt;/xs:simpleType&gt; 
             
             
                &lt;xs:simpleType name=“ClusteringPropertyType”&gt; 
             
             
                 &lt;xs:restriction base=“xs:string”&gt; 
             
             
                  &lt;xs:pattern value=“Non Clustered” /&gt; 
             
             
                  &lt;xs:pattern value=“Clustered” /&gt; 
             
             
                  &lt;xs:pattern value=“Unique” /&gt; 
             
             
                 &lt;/xs:restriction&gt; 
             
             
                &lt;/xs:simpleType&gt; 
             
             
                &lt;xs:simpleType name=“UniquenessPropertyType”&gt; 
             
             
                 &lt;xs:restriction base=“xs:string”&gt; 
             
             
                  &lt;xs:pattern value=“Non Unique” /&gt; 
             
             
                  &lt;xs:pattern value=“Unique” /&gt; 
             
             
                 &lt;/xs:restriction&gt; 
             
             
                &lt;/xs:simpleType&gt; 
             
             
                &lt;xs:simpleType name=“IsIndexKeyType”&gt; 
             
             
                 &lt;xs:restriction base=“xs:string”&gt; 
             
             
                  &lt;xs:enumeration value=“no” /&gt; 
             
             
                  &lt;xs:enumeration value=“yes” /&gt; 
             
             
                 &lt;/xs:restriction&gt; 
             
             
                &lt;/xs:simpleType&gt; 
             
             
                &lt;xs:simpleType name=“NameType”&gt; 
             
             
                 &lt;xs:restriction base=“xs:string”&gt; 
             
             
                  &lt;xs:pattern value=“[a-zA-Z#_][a-zA-Z0-9_]+” /&gt; 
             
             
                 &lt;/xs:restriction&gt; 
             
             
                &lt;/xs:simpleType&gt; 
             
             
               &lt;/xs:schema&gt; 
             
             
                 
             
           
        
       
     
   
   As can be seen from the WorkloadAnalysis.xsd file in Table 1, the schema consists of identifying tags that are placed around information of interest for workload analysis. For example, the following information is included in the XML file version of the structured workload information (SWI)  222  with respect to the syntactic analysis of a workload event: SQL string for the statement, a statement category, a list of tables and columns referenced or updated by the statement, a list of Projection columns, a list of Group By columns, a list of Order By columns, and a list of predicates trees consisting of AND/OR/NOT of atomic join and selection conditions. 
   The following plan information for the statement is included in the XML structured workload information (SWI)  222 : total optimizer estimated cost of executing the statement, estimated cardinality of the output of the statement, and a sequence of logical and physical operators and their arguments used in the plan. Execution information including the actual cost of executing the statement and the actual cardinality of the output of the statement are also stored in the structured workload information (SWI)  222  by the SWI populator  216 . 
   As can be seen from the foregoing description, a structured workload information (SWI) can be created that facilitates ad hoc analysis by relatively unskilled operators. The structured workload information can feature workload information according to a variety of schemas such as a relational format, OLAP, or XML. The schema may be selected based on the end user&#39;s analysis technique. Although the present invention has been described with a degree of particularity, it is the intent that the invention include all modifications and alterations from the disclosed design falling within the spirit or scope of the appended claims.