<html>
  <head>
    <title>Test Results</title>
    <style>
      td.winner { background-color: lightgreen; }
      td.loser { background-color: lightyellow; }
      td.mismatch { background-color: lightred; }
      th { text-align: left; }
    </style>
  </head>
  <body>
    <h1>Test Results</h1>
    
    <h2>Summary</h2>
    
    <table border="1">
      <tr>
        <th>Test</th>
        
          <th>Real</th>
        
          <th>Distributed</th>
        
          <th>Real Distributed</th>
        
        <th>Count</th>
      </tr>
      
        
        <tr>
          <td>
            <a href="#1 str">1 str</a>
          </td>
          
            
              <td class="winner">
                ~0.993886
              </td>
            
          
            
              <td class="loser">
                ~6.8578796
              </td>
            
          
            
              <td></td>
            
          
          <td class="">
            7978
          </td>
        </tr>
      
        
        
        <tr>
          <td>
            <a href="#1 str bzlike">1 str bzlike</a>
          </td>
          
            
              <td class="loser">
                ~1.1808312
              </td>
            
          
            
              <td class="loser">
                ~13.7288768
              </td>
            
          
            
              <td class="winner">
                ~0.3499588
              </td>
            
          
          <td class="">
            7978
          </td>
        </tr>
      
        
        
        <tr>
          <td>
            <a href="#2 str">2 str</a>
          </td>
          
            
              <td class="winner">
                ~1.5040798
              </td>
            
          
            
              <td class="loser">
                ~11.23501
              </td>
            
          
            
              <td></td>
            
          
          <td class="">
            215
          </td>
        </tr>
      
        
        
        <tr>
          <td>
            <a href="#3 str">3 str</a>
          </td>
          
            
              <td class="winner">
                ~1.5099744
              </td>
            
          
            
              <td class="loser">
                ~11.7792148
              </td>
            
          
            
              <td></td>
            
          
          <td class="">
            8
          </td>
        </tr>
      
        
        
        <tr>
          <td>
            <a href="#10 str">10 str</a>
          </td>
          
            
              <td class="winner">
                ~1.4827098
              </td>
            
          
            
              <td class="loser">
                ~11.93709
              </td>
            
          
            
              <td></td>
            
          
          <td class="">
            0
          </td>
        </tr>
      
        
        
        <tr>
          <td>
            <a href="#1 int bzlike">1 int bzlike</a>
          </td>
          
            
              <td class="loser">
                ~1.4946862
              </td>
            
          
            
              <td class="winner">
                ~1.0302834
              </td>
            
          
            
              <td></td>
            
          
          <td class="">
            149956
          </td>
        </tr>
      
        
        <tr>
          <td>
            <a href="#1 str, 1 int">1 str, 1 int</a>
          </td>
          
            
              <td class="winner">
                ~0.9463084
              </td>
            
          
            
              <td class="loser">
                ~11.3229642
              </td>
            
          
            
              <td></td>
            
          
          <td class="">
            3899
          </td>
        </tr>
      
        
        
        <tr>
          <td>
            <a href="#2 str, 2 int">2 str, 2 int</a>
          </td>
          
            
              <td class="winner">
                ~1.5296508
              </td>
            
          
            
              <td class="loser">
                ~13.3328728
              </td>
            
          
            
              <td></td>
            
          
          <td class="">
            52
          </td>
        </tr>
      
        
        
        <tr>
          <td>
            <a href="#simple b.m.o query">simple b.m.o query</a>
          </td>
          
            
              <td class="loser">
                ~0.0054942
              </td>
            
          
            
              <td class="loser">
                ~0.0011004
              </td>
            
          
            
              <td class="winner">
                ~0.001
              </td>
            
          
          <td class="">
            0
          </td>
        </tr>
      
        
    </table>

    
      
      <h2><a name="1 str">1 str</a></h2>
      <p></p>
      
        
        <h3>Real</h3>
        <p>Query: SELECT COUNT(*) FROM realcol WHERE INSTR(cf_aa, 'meta')</p>
        <p>Times: 2.400455, 1.010951, 0.984267, 0.972287, 1.030088, 0.971837</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>realcol</td>
                
                <td>ALL</td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td>300000</td>
                
                <td>where used</td>
                
            </tr>
          
        </table>
      
        
        <h3>Distributed</h3>
        <p>Query: SELECT COUNT(*) FROM distcol_str WHERE field_id = 0 AND INSTR(value, 'meta')</p>
        <p>Times: 56.222814, 17.188263, 7.289817, 4.417872, 3.033833, 2.359613</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>distcol_str</td>
                
                <td>ref</td>
                
                <td>field_id</td>
                
                <td>field_id</td>
                
                <td>4</td>
                
                <td>const</td>
                
                <td>324256</td>
                
                <td>where used</td>
                
            </tr>
          
        </table>
      
        
    
      
      
      <h2><a name="1 str bzlike">1 str bzlike</a></h2>
      <p>like the one-string query, but it joins tables in the distributed and real distributed queries just like Bugzilla would</p>
      
        
        <h3>Real</h3>
        <p>Query: SELECT COUNT(*) FROM realcol WHERE INSTR(cf_aa, 'meta')</p>
        <p>Times: 17.872328, 2.203316, 0.943009, 0.915909, 0.922373, 0.919549</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>realcol</td>
                
                <td>ALL</td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td>300000</td>
                
                <td>where used</td>
                
            </tr>
          
        </table>
      
        
        <h3>Distributed</h3>
        <p>Query: SELECT COUNT(*) FROM realcol, distcol_str WHERE realcol.bug_id = distcol_str.bug_id AND field_id = 0 AND INSTR(value, 'meta')</p>
        <p>Times: 55.296815, 50.380695, 9.647647, 3.145405, 2.698026, 2.772611</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>realcol</td>
                
                <td>index</td>
                
                <td>PRIMARY</td>
                
                <td>PRIMARY</td>
                
                <td>4</td>
                
                <td></td>
                
                <td>300000</td>
                
                <td>Using index</td>
                
            </tr>
          
            <tr>
              
                <td>distcol_str</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>realcol.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
        </table>
      
        
        <h3>Real Distributed</h3>
        <p>Query: SELECT COUNT(*) FROM realcol, cf_aa WHERE realcol.bug_id = cf_aa.bug_id AND INSTR(cf_aa.cf_aa, 'meta')</p>
        <p>Times: 2.367049, 0.447856, 0.328695, 0.323859, 0.326075, 0.323309</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>cf_aa</td>
                
                <td>ALL</td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td>300000</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>realcol</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY</td>
                
                <td>PRIMARY</td>
                
                <td>4</td>
                
                <td>cf_aa.bug_id</td>
                
                <td>1</td>
                
                <td>Using index</td>
                
            </tr>
          
        </table>
      
    
      
      
      <h2><a name="2 str">2 str</a></h2>
      <p></p>
      
        
        <h3>Real</h3>
        <p>Query: SELECT COUNT(*) FROM realcol WHERE INSTR(cf_aa, 'meta') AND INSTR(cf_ab, 'meta')</p>
        <p>Times: 24.248208, 3.802007, 0.932226, 0.925925, 0.931555, 0.928686</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>realcol</td>
                
                <td>ALL</td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td>300000</td>
                
                <td>where used</td>
                
            </tr>
          
        </table>
      
        
        <h3>Distributed</h3>
        <p>Query: SELECT COUNT(*) FROM distcol_str d1, distcol_str d2 WHERE d1.bug_id = d2.bug_id AND d1.field_id =0 AND d2.field_id = 1 AND INSTR(d1.value, 'meta') AND INSTR(d2.value, 'meta')</p>
        <p>Times: 59.490412, 44.054879, 7.302122, 1.969473, 1.430966, 1.41761</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>d2</td>
                
                <td>ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>field_id</td>
                
                <td>4</td>
                
                <td>const</td>
                
                <td>301378</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d1</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d2.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
        </table>
      
        
    
      
      
      <h2><a name="3 str">3 str</a></h2>
      <p></p>
      
        
        <h3>Real</h3>
        <p>Query: SELECT COUNT(*) FROM realcol WHERE INSTR(cf_aa, 'meta') AND INSTR(cf_ab, 'meta') AND INSTR(cf_ac, 'meta')</p>
        <p>Times: 24.079237, 3.800839, 0.937489, 0.934069, 0.937878, 0.939597</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>realcol</td>
                
                <td>ALL</td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td>300000</td>
                
                <td>where used</td>
                
            </tr>
          
        </table>
      
        
        <h3>Distributed</h3>
        <p>Query: SELECT COUNT(*) FROM distcol_str d1, distcol_str d2, distcol_str d3 WHERE d1.bug_id = d2.bug_id AND d2.bug_id = d3.bug_id AND d1.field_id = 0 and d2.field_id = 1 AND d3.field_id = 2 and INSTR(d1.value, 'meta') AND INSTR(d2.value, 'meta') AND INSTR(d3.value, 'meta')</p>
        <p>Times: 63.77199, 46.517752, 7.558007, 1.821555, 1.443056, 1.555704</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>d3</td>
                
                <td>ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>field_id</td>
                
                <td>4</td>
                
                <td>const</td>
                
                <td>291921</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d2</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d3.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d1</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d2.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
        </table>
      
        
    
      
      
      <h2><a name="10 str">10 str</a></h2>
      <p></p>
      
        
        <h3>Real</h3>
        <p>Query: SELECT COUNT(*) FROM realcol WHERE INSTR(cf_aa, 'meta') AND INSTR(cf_ab, 'meta') AND INSTR(cf_ac, 'meta') AND INSTR(cf_ad, 'meta') AND INSTR(cf_ae, 'meta') AND INSTR(cf_af, 'meta') AND INSTR(cf_ag, 'meta') AND INSTR(cf_ah, 'meta') AND INSTR(cf_ai, 'meta') AND INSTR(cf_aj, 'meta')</p>
        <p>Times: 24.036193, 3.670253, 0.934965, 0.935895, 0.934874, 0.937562</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>realcol</td>
                
                <td>ALL</td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td>300000</td>
                
                <td>where used</td>
                
            </tr>
          
        </table>
      
        
        <h3>Distributed</h3>
        <p>Query: SELECT COUNT(*) FROM distcol_str d1, distcol_str d2, distcol_str d3, distcol_str d4, distcol_str d5, distcol_str d6, distcol_str d7, distcol_str d8, distcol_str d9, distcol_str d10 WHERE d1.bug_id = d2.bug_id AND d2.bug_id = d3.bug_id AND d3.bug_id = d4.bug_id AND d4.bug_id = d5.bug_id AND d5.bug_id = d6.bug_id AND d6.bug_id = d7.bug_id AND d7.bug_id = d8.bug_id AND d8.bug_id = d9.bug_id AND d9.bug_id = d10.bug_id AND d1.field_id = 0 AND d2.field_id = 1 AND d3.field_id = 2 AND d4.field_id = 3 AND d5.field_id = 4 AND d6.field_id = 5 AND d7.field_id = 6 AND d8.field_id = 7 AND d9.field_id = 8 AND d10.field_id = 9 AND INSTR(d1.value, 'meta') AND INSTR(d2.value, 'meta') AND INSTR(d3.value, 'meta') AND INSTR(d4.value, 'meta') AND INSTR(d5.value, 'meta') AND INSTR(d6.value, 'meta') AND INSTR(d7.value, 'meta') AND INSTR(d8.value, 'meta') AND INSTR(d9.value, 'meta') AND INSTR(d10.value, 'meta')</p>
        <p>Times: 62.801271, 46.975707, 7.908287, 1.970218, 1.414651, 1.416587</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>d10</td>
                
                <td>ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>field_id</td>
                
                <td>4</td>
                
                <td>const</td>
                
                <td>280301</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d9</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d10.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d8</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d9.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d7</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d8.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d6</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d7.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d5</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d6.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d4</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d5.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d3</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d4.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d2</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d3.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d1</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d2.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
        </table>
      
        
    
      
      
      <h2><a name="1 int bzlike">1 int bzlike</a></h2>
      <p></p>
      
        
        <h3>Real</h3>
        <p>Query: SELECT COUNT(*) FROM realcol WHERE cf_int1 > 500</p>
        <p>Times: 24.206918, 3.758885, 0.872744, 0.869153, 0.868562, 1.104087</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>realcol</td>
                
                <td>ALL</td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td>300000</td>
                
                <td>where used</td>
                
            </tr>
          
        </table>
      
        
        <h3>Distributed</h3>
        <p>Query: SELECT COUNT(*) FROM realcol, distcol_int d2 WHERE realcol.bug_id = d2.bug_id AND d2.field_id = 10 AND d2.value > 500</p>
        <p>Times: 5.457322, 1.013369, 1.072258, 1.014025, 1.017719, 1.034046</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>d2</td>
                
                <td>ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>field_id</td>
                
                <td>4</td>
                
                <td>const</td>
                
                <td>316832</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>realcol</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY</td>
                
                <td>PRIMARY</td>
                
                <td>4</td>
                
                <td>d2.bug_id</td>
                
                <td>1</td>
                
                <td>Using index</td>
                
            </tr>
          
        </table>
      
        
    
      
      <h2><a name="1 str, 1 int">1 str, 1 int</a></h2>
      <p></p>
      
        
        <h3>Real</h3>
        <p>Query: SELECT COUNT(*) FROM realcol WHERE INSTR(cf_aa, 'meta') AND cf_int1 > 500</p>
        <p>Times: 1.123152, 0.943802, 0.932727, 0.936969, 0.9778, 0.940244</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>realcol</td>
                
                <td>ALL</td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td>300000</td>
                
                <td>where used</td>
                
            </tr>
          
        </table>
      
        
        <h3>Distributed</h3>
        <p>Query: SELECT COUNT(*) FROM distcol_str d1, distcol_int d2 WHERE d1.bug_id = d2.bug_id AND d1.field_id = 0 AND d2.field_id = 10 AND INSTR(d1.value, 'meta') AND d2.value > 500</p>
        <p>Times: 57.02676, 41.320932, 8.477756, 2.765745, 2.104191, 1.946197</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>d2</td>
                
                <td>ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>field_id</td>
                
                <td>4</td>
                
                <td>const</td>
                
                <td>316832</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d1</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d2.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
        </table>
      
        
    
      
      
      <h2><a name="2 str, 2 int">2 str, 2 int</a></h2>
      <p></p>
      
        
        <h3>Real</h3>
        <p>Query: SELECT COUNT(*) FROM realcol WHERE INSTR(cf_aa, 'meta') AND instr(cf_ab, 'meta') AND cf_int1 > 500 AND cf_int2 > 500</p>
        <p>Times: 23.922012, 3.881854, 0.927738, 0.921162, 0.987386, 0.930114</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>realcol</td>
                
                <td>ALL</td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td>300000</td>
                
                <td>where used</td>
                
            </tr>
          
        </table>
      
        
        <h3>Distributed</h3>
        <p>Query: SELECT COUNT(*) FROM distcol_str d1, distcol_str d2, distcol_int d3, distcol_int d4 WHERE d1.bug_id = d2.bug_id AND d2.bug_id = d3.bug_id AND d3.bug_id = d4.bug_id AND d1.field_id = 0 AND d2.field_id = 1 AND d3.field_id = 10 AND d4.field_id = 11 AND INSTR(d1.value, 'meta') AND INSTR(d2.value, 'meta') AND d3.value > 500 AND d4.value > 500</p>
        <p>Times: 77.469662, 49.102933, 10.075697, 2.814618, 2.527861, 2.143255</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>d4</td>
                
                <td>ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>field_id</td>
                
                <td>4</td>
                
                <td>const</td>
                
                <td>283167</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d3</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d4.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d2</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d3.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>d1</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>PRIMARY</td>
                
                <td>8</td>
                
                <td>d2.bug_id,const</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
        </table>
      
        
    
      
      
      <h2><a name="simple b.m.o query">simple b.m.o query</a></h2>
      <p></p>
      
        
        <h3>Real</h3>
        <p>Query: SELECT bugs.bug_id, bugs.bug_severity, bugs.priority, bugs.bug_status, bugs.resolution, bugs.bug_severity, bugs.priority, bugs.rep_platform, map_assigned_to.login_name, bugs.bug_status, bugs.resolution, bugs.short_desc FROM bugs, profiles AS map_assigned_to LEFT JOIN bug_group_map ON bug_group_map.bug_id = bugs.bug_id WHERE bugs.assigned_to = map_assigned_to.userid AND ((INSTR(LOWER(bugs.status_whiteboard), 'meta'))) AND ((bug_group_map.group_id IS NULL)) GROUP BY bugs.bug_id ORDER BY bugs.bug_id</p>
        <p>Times: 0.180209, 0.005259, 0.005188, 0.005131, 0.006775, 0.005118</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>bugs</td>
                
                <td>ALL</td>
                
                <td>assigned_to</td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td>1523</td>
                
                <td>where used; Using temporary</td>
                
            </tr>
          
            <tr>
              
                <td>map_assigned_to</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY</td>
                
                <td>PRIMARY</td>
                
                <td>3</td>
                
                <td>bugs.assigned_to</td>
                
                <td>1</td>
                
                <td></td>
                
            </tr>
          
            <tr>
              
                <td>bug_group_map</td>
                
                <td>ref</td>
                
                <td>bug_id</td>
                
                <td>bug_id</td>
                
                <td>3</td>
                
                <td>bugs.bug_id</td>
                
                <td>4</td>
                
                <td>where used; Using index; Not exists</td>
                
            </tr>
          
        </table>
      
        
        <h3>Distributed</h3>
        <p>Query: SELECT bugs.bug_id, bugs.bug_severity, bugs.priority, bugs.bug_status, bugs.resolution, bugs.bug_severity, bugs.priority, bugs.rep_platform, map_assigned_to.login_name, bugs.bug_status, bugs.resolution, bugs.short_desc FROM bugs, profiles AS map_assigned_to LEFT JOIN bug_group_map ON bug_group_map.bug_id = bugs.bug_id, distcol_str WHERE bugs.bug_id = distcol_str.bug_id AND bugs.assigned_to = map_assigned_to.userid AND distcol_str.field_id = 11 AND ((INSTR(LOWER(distcol_str.value), 'meta'))) AND ((bug_group_map.group_id IS NULL)) GROUP BY bugs.bug_id ORDER BY bugs.bug_id</p>
        <p>Times: 0.001086, 0.001111, 0.001061, 0.001196, 0.001063, 0.001071</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>distcol_str</td>
                
                <td>ref</td>
                
                <td>PRIMARY,field_id</td>
                
                <td>field_id</td>
                
                <td>4</td>
                
                <td>const</td>
                
                <td>87</td>
                
                <td>where used; Using temporary</td>
                
            </tr>
          
            <tr>
              
                <td>bugs</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,assigned_to</td>
                
                <td>PRIMARY</td>
                
                <td>3</td>
                
                <td>distcol_str.bug_id</td>
                
                <td>1</td>
                
                <td>where used</td>
                
            </tr>
          
            <tr>
              
                <td>map_assigned_to</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY</td>
                
                <td>PRIMARY</td>
                
                <td>3</td>
                
                <td>bugs.assigned_to</td>
                
                <td>1</td>
                
                <td></td>
                
            </tr>
          
            <tr>
              
                <td>bug_group_map</td>
                
                <td>ref</td>
                
                <td>bug_id</td>
                
                <td>bug_id</td>
                
                <td>3</td>
                
                <td>bugs.bug_id</td>
                
                <td>4</td>
                
                <td>where used; Using index; Not exists</td>
                
            </tr>
          
        </table>
      
        
        <h3>Real Distributed</h3>
        <p>Query: SELECT bugs.bug_id, bugs.bug_severity, bugs.priority, bugs.bug_status, bugs.resolution, bugs.bug_severity, bugs.priority, bugs.rep_platform, map_assigned_to.login_name, bugs.bug_status, bugs.resolution, bugs.short_desc FROM bugs, profiles AS map_assigned_to LEFT JOIN bug_group_map ON bug_group_map.bug_id = bugs.bug_id, status_whiteboard WHERE bugs.bug_id = status_whiteboard.bug_id AND bugs.assigned_to = map_assigned_to.userid AND ((INSTR(LOWER(status_whiteboard.status_whiteboard), 'meta'))) AND ((bug_group_map.group_id IS NULL)) GROUP BY bugs.bug_id ORDER BY bugs.bug_id</p>
        <p>Times: 0.001303, 0.000981, 0.001254, 0.000928, 0.00092, 0.000917</p>
        <table border="1">
          <caption>Explanation</caption>
          <tr>
            <th>id</th>
            <th>select_type</th>
            <th>table</th>
            <th>type</th>
            <th>possible_keys</th>
            <th>key</th>
            <th>key_len</th>
            <th>ref</th>
            <th>rows</th>
            <th>Extra</th>
          </tr>
          
            <tr>
              
                <td>status_whiteboard</td>
                
                <td>ALL</td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td></td>
                
                <td>22</td>
                
                <td>where used; Using temporary</td>
                
            </tr>
          
            <tr>
              
                <td>bugs</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY,assigned_to</td>
                
                <td>PRIMARY</td>
                
                <td>3</td>
                
                <td>status_whiteboard.bug_id</td>
                
                <td>1</td>
                
                <td></td>
                
            </tr>
          
            <tr>
              
                <td>map_assigned_to</td>
                
                <td>eq_ref</td>
                
                <td>PRIMARY</td>
                
                <td>PRIMARY</td>
                
                <td>3</td>
                
                <td>bugs.assigned_to</td>
                
                <td>1</td>
                
                <td></td>
                
            </tr>
          
            <tr>
              
                <td>bug_group_map</td>
                
                <td>ref</td>
                
                <td>bug_id</td>
                
                <td>bug_id</td>
                
                <td>3</td>
                
                <td>bugs.bug_id</td>
                
                <td>4</td>
                
                <td>where used; Using index; Not exists</td>
                
            </tr>
          
        </table>
      
    
      
  </body>
</html>