<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../xsl/road-faq.xsl"?>
<rf:topic xmlns:xs="http://www.w3.org/2001/XMLSchema"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:rf="http://schemas.mathsoft.com/road-faq-1"
          xmlns:rs="http://schemas.mathsoft.com/road-database-schema-1"
          xsi:schemaLocation="http://schemas.mathsoft.com/road-faq-1 ../xsl/road-faq.xsd"
          title="Road Database Schema"
          file="roaddb-schema-faq.xml">
   <rf:section id="roaddb-links" title="Useful links">
        <div class="twocol">
            <div class="col leftcol">
               Header A
                <ul>
               <li>
                    Item A
                </li>
            </ul>
                
                Help
                <ul>
               <li>
                </li>
               <li>
                    <rf:iref item="setup-oxygen"/>
                </li>
            </ul>
                
            </div>
            <div class="col rightcol">
                Main Tables and Domains
                <ul>
               <li>
                </li>
               <li>
                    <a href="db-sample.sql">Physical schema</a>
                </li>
               <li>
                </li>
            </ul>
                
                Main Views
                <ul>
               <li>
                    <rf:iref item="rdv_view"/>
                </li>
               <li>
                </li>
            </ul>
            </div>
        </div>
    </rf:section>
   <rf:section id="faq-sample" title="FAQ on sample">
        <rf:item id="faq-A" title="Question A">
            <p>Some text
            </p>
            <ul>
            <li>
                A list item
            </li>
            <li>
            </li>
         </ul>
        </rf:item>
        
        

        
        
        
        
        
        

    </rf:section>
   <rf:section id="roaddb-domains" title="Column domains">
      <rf:item id="generic-domains" title="RoadDB Generic ID domains">
         <p>
            
            
        </p>
            Domains
            <ul>
            <li>Any Name ID -- <a name="name-id-domain"/>[varchar(100)]  Use
                <code>name-id</code> for ID fields defined by a string. Consider
                <code>name-id</code> for all IDs. Use an <rf:iref item="identity-domain"/> domain only when the ID would otherwise
                be longer than 30 characters or so. </li>
            <li>Identity -- <a name="identity-domain"/>[int] 
                Need to mark the identity column with identity="yes".  Use an <i>identity-domain</i>
                for tables used for foreign-keys especially if they have a multi-column index.
                Be careful of migration and backup.  Use 'SET IDENTITY_INSERT' to preserve identity
                values.
            </li>
         </ul>
      </rf:item>
      <rf:item id="ID-domains" title="RoadDB ID domains">
         <p>
            An ID domain is a foreign key reference to a table defining the domain.
            
            
                
                </p>
            Domains
            <ul>
            <li>Codeline -- <a name="codeline-domain"/>[ <rf:iref item="name-id-domain"/>]  A
                <i>codeline</i> is a set of files that change together, typically for building a
                product.   Converted to lower-case.</li>
            <li>Build -- <a name="build-domain"/>[<rf:iref item="builds" part="codeline,build"/>
               <rf:iref item="name-id-domain"/>]  A <i>build</i> is a
                build of a product.   Builds are ordered alphabetically, matching their temporal
                order.
                 Converted to lower-case. 
                Requires <code>foreign-columns="codeline,build"</code>
            </li>
         </ul>
      </rf:item>
      <rf:item id="string-domains" title="RoadDB String domains">
         <p>
            
            
            
            
            </p>
            Domains
            <ul>
            <li>File path -- <a name="filepath-domain"/>[varchar(1000)]  A <i>file
                path</i> is the actual name and location of a file on a machine. </li>
            <li>URL for file -- <a name="url-domain"/>[varchar(1000)]  A <i>URL</i>
                is a relative path to a file for the database web site or the absolute path to a
                networked resource.</li>
            <li>Long string values -- <a name="long-string-domain"/>[varchar(max)]  
                A <i>Long String Value</i> is the maximum varchar string, e.g., for concatenating
                string values </li>
            <li>String values -- <a name="string-domain"/>[varchar(1000)]  
                A <i>String Value</i> is the value for a keyword or other entity </li>
         </ul>
      </rf:item>
      <rf:item id="numeric-domains" title="RoadDB Numeric domains">
         <p>
            
            
            
            
            
            
            
        </p>
            Domains
            <ul>
            <li>Count -- <a name="count-domain"/>[int]  A <i>count</i> is up to 2^31 </li>
            <li>Count up to 32,000 -- <a name="count-32000-domain"/>[smallint]  A
                <i>count-32000</i> is -32,768 to 32,767 (16 bits)</li>
            <li>Count up to 255 -- <a name="count-255-domain"/>[tinyint]  A
                <i>count-255</i> is 0 to 255 (8 bits) </li>
            <li>True or false -- <a name="boolean-domain"/>[bit]  A <i>boolean</i> is
                true (1) or false (0) </li>
            <li>Floating point value -- <a name="real-domain"/>[real]  A <i>real</i>
                is a 4 byte floating point number up to 10^-38</li>
            <li>Short real -- <a name="shortreal-domain"/>[float(24)] 
            </li>
         </ul>
      </rf:item>
      <rf:item id="temporal-domains" title="RoadDB Temporal domains">
         <p>
            
        
            
            
        </p>
            Domains
            <ul>
            <li>Short Time -- <a name="minute-time-domain"/>[smalldatetime]  Local time of
            event in minutes. </li>
            <li>Time -- <a name="millisec-time-domain"/>[datetime]  Local time of
                event with millisecond resolution. </li>
         </ul>
      </rf:item>
   </rf:section>
   <rf:section id="table-functions" title="Parameterized Views">

            
           <p>Parameterized views (aka <i>inline table functions</i>) are used for summary reports
                and comparisons between builds.  To view all fields of the data tables, see <rf:iref item="views"/>.  
            </p>
        <rf:item id="rf_build_testcases"
               title="RoadDB rf_build_testcases -- Classify test cases">
         <p>
               Classify test cases from @first_build to @last_build as compared to @prev_codeline/@prev_build
               <p>Arguments: prev_codeline, prev_build, codeline, first_build, last_build </p>
                 
               </p> 
                  Columns
                   <ul>
            <li>
build -- <rf:iref item="builds" part="build"/>  
                    The max run for each build in the table.  Does not include the comparison build
                </li>
         </ul>
      </rf:item>
   </rf:section>
   <rf:section id="views" title="Views">

            See 
            <a href="../RoadDB/sql/Road-views.sql">Road-views.sql</a>.  
            
            
            
        <rf:item id="rdv_testcases"
               title="RoadDB rdv_testcases -- All fields for test cases of the max run for each build">
         <p>
                 
            </p> 
                  Columns
                   <ul>
            <li>
build -- <rf:iref item="rf_build_testcases" part="build"/>  
            </li>
         </ul>
      </rf:item>
   </rf:section>
   <rf:section id="road-db" title="Primary tables">

            
            

        <rf:item id="builds" title="RoadDB builds -- A run of a test file">
         <p>
                
                
                
            </p> 
                  Columns
                   <ul>
            <li>
codeline -- <rf:iref item="codeline-domain" part=""/> index=primary_index index-columns=codeline,build  
                    Currently non-clustered.  Will need to rebuild the database due to foreign keys.
                </li>
            <li>
build -- <rf:iref item="build-domain" part=""/>  
                    Build reports assume that 'build' is ordered alphabetically within a
                    codeline.
                </li>
            <li>
build_date -- <rf:iref item="minute-time-domain" part=""/>  
                    If a build is only known from new_testcase_pass, its build-date is '2100-01-01'.
                </li>
         </ul>
      </rf:item>
   </rf:section>
   <rf:section id="permanent-tables" title="Permanent tables">

            These tables do not exist else where.  Do not delete.
            
            
            
            
         <rf:item id="configuration"
               title="RoadDB configuration -- Configuration keywords and their                  values">
         <p>
                
                
                
            </p> 
                  Columns
                   <ul>
            <li>
section -- <rf:iref item="name-id-domain" part=""/> index-columns=section,keyword  
                    <i>Section</i> identifies a group of keywords.
                </li>
            <li>
keyword -- <rf:iref item="name-id-domain" part=""/>  
            </li>
            <li>
value -- <rf:iref item="string-domain" part=""/>  
            </li>
         </ul>
      </rf:item>
      <rf:item id="eventlog" title="RoadDB eventlog -- Event and message log">
         <p>
                
                
                
                
                
            </p> 
                  Columns
                   <ul>
            <li>
logtime -- <rf:iref item="millisec-time-domain" part=""/> default=getdate() index-columns=logtime,event_type  </li>
            <li>
event_type -- <rf:iref item="event-type-domain" part=""/>  
            </li>
            <li>
event -- <rf:iref item="event-domain" part=""/>  
            </li>
            <li>
value -- <rf:iref item="count-domain" part=""/> null=yes  
                    Optional integer value
                </li>
            <li>
message -- <rf:iref item="long-string-domain" part=""/> null=yes  </li>
         </ul>
      </rf:item>
   </rf:section>
   <rf:section id="import-data" title="Imported tables">

            Imported data should not depend on other tables.  Use 'level="a"'."  Use 'isnew' to
            record processed entries.  All of these tables are temporary and may be deleted as
             needed.           
        </rf:section>
   <rf:section id="derived-tables" title="Derived tables">

            Maintained by rdz_DatabaseNewTables.
              
            
            
          
        <rf:item id="data_errors" title="RoadDB data_errors -- Imported data errors">
         <p>
                  Cleared at the beginning of each import.
                  
                  
                  
                  
                  
                  
              </p> 
                  Columns
                   <ul>
            <li>
ID -- <rf:iref item="string-domain" part=""/>  
            </li>
            <li>
build -- <rf:iref item="build-domain" part=""/> foreign-key=no  
                      To rebuild, use rdz_DeleteBuildsFrom this_build.
                  </li>
            <li>
field_name -- <rf:iref item="name-id-domain" part=""/>  
            </li>
            <li>
table_name -- <rf:iref item="name-id-domain" part=""/>  
            </li>
            <li>
reason -- <rf:iref item="string-domain" part=""/>  
            </li>
            <li>
row_num -- <rf:iref item="count-domain" part=""/> default=0  </li>
         </ul>
      </rf:item>
      <rf:item id="domain_values"
               title="RoadDB domain_values -- Value counts for each                 name-id column">
         <p>
                
                
                
                
            </p> 
                  Columns
                   <ul>
            <li>
tbl -- <rf:iref item="string-domain" part=""/>  
            </li>
            <li>
col -- <rf:iref item="string-domain" part=""/>  
            </li>
            <li>
val -- <rf:iref item="string-domain" part=""/>  
            </li>
            <li>
cnt -- <rf:iref item="count-domain" part=""/> default=0  </li>
         </ul>
      </rf:item>
   </rf:section>
</rf:topic>