<?xml version="1.0" encoding="utf-8"?>	
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <channel>
    
    <title>ICE Wiki</title>
    <link>http://www.infobright.org/wiki/</link>
    <description>ICE Wiki</description>
    <dc:language>en</dc:language>
    <dc:creator>do-not-reply@infobright.com</dc:creator>
    <dc:rights>Copyright 2008</dc:rights>
    <dc:date>2010-03-19T19:47:41+00:00</dc:date>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />
    

    <item>
      <title>Tar Upgrade Guide</title>
      <link>http://www.infobright.org/wiki/Tar_Upgrade_Guide/</link>
      <guid>http://www.infobright.org/wiki/Tar_Upgrade_Guide/</guid>
      <description><![CDATA[	<p><b>Upgrade Instructions for Linux Tar Packages</b></p>

	<p><b>Note:</b> Due to the port to MySQL 5.1 GA, the underlying data structures have changed. Please see step 4 below on how to run the MySQL Updater to migrate your previous database to 3.1.1 during the upgrade. After upgrading to 3.1.1 you will not be able to use a 3.1.1 database with a previous versions of <span class="caps">ICE</span>. We recommend you backup your data before upgrading in case you wish to downgrade for any reason.</p>

	<p>1.    Obtain root user access </p>

	<p>2.    Unpack the tarball into a temporary folder:</p>

	<p style="padding-left:2em;"><code>cd /path/to/temp/</code><br />
<code>gunzip</code> &lt; <code>/path/to/infobright-3.3.1-x86_64.tar.gz | tar xvf -</code><br />
<code>cd infobright-3.3.1-x86_64</code></p>

	<p>3. Stop the Infobright server:</p>

	<p style="padding-left:2em;"><code>/etc/init.d/mysqld-ib stop</code></p>

	<p>3. Run the install script with the <code>&quot;--upgrade” and “--config”</code> flags and pass in the configuration files of the previously installed version:</p>

	<p style="padding-left:2em;"><code>./install-infobright.sh  --upgrade --config=/etc/my-ib.cnf</code></p>

	<p><b>4. Start the Infobright server and run the mysql_upgrade utility:</b></p>

	<p style="padding-left:2em;"><code>/etc/init.d/mysqld-ib start</code><br />
<code>cd /usr/local/infobright</code><br />
<code>./bin/mysql_upgrade --defaults-file=/etc/my-ib.cnf --user=root --tmpdir=/tmp</code></p>

	<p><b>Important:</b> The MySQL Upgrade utility may display several errors regarding the use of locks with log tables and errors requiring table upgrades. The errors are all handled automatically by Infobright and/or the upgrade utility and can be ignored.</p>

	<p>5. Re-start the Infobright server:</p>

	<p style="padding-left:2em;"><code>/etc/init.d/mysqld-ib restart</code></p>

	<p>6. Confirm the build version as IB_3.3.1_r6997_7017:</p>

	<p style="padding-left:2em;"><code>/usr/local/infobright/bin/mysqld --version</code></p>]]></description>
      <dc:subject>Tar Upgrade Guide</dc:subject>
      <dc:date>2010-03-19T19:47:41+00:00</dc:date>
    </item>

    <item>
      <title>Upgrade Guide for Windows</title>
      <link>http://www.infobright.org/wiki/Upgrade_Guide_for_Windows/</link>
      <guid>http://www.infobright.org/wiki/Upgrade_Guide_for_Windows/</guid>
      <description><![CDATA[	<p><b>Note:</b> These instructions are for upgrading on Windows XP. For upgrading on Linux platforms, please see the Linux <a href="http://www.infobright.org/wiki/Upgrade_Guide/" title="Upgrade_Guide">Upgrade Guide</a>.</p>

	<p><b>Note:</b> Due to the port to MySQL 5.1 GA, the underlying data structures have changed. Please see step 3 below on how to run the MySQL Updater to migrate your previous database to 3.1.1 during the upgrade. After upgrading to 3.1.1 you will not be able to use a 3.1.1 database with a previous versions of <span class="caps">ICE</span>. We recommend you backup your data before upgrading in case you wish to downgrade for any reason.</p>

	<p>1. Stop <span class="caps">ICE</span> using the Start Menu item.</p>

	<p>2. Follow the <a href="http://www.infobright.org/wiki/Install_Guide_for_Windows/" title="Install_Guide_for_Windows">Install Guide for Windows</a>. The Install Wizard automatically detects a previous version of <span class="caps">ICE</span> and upgrades your <span class="caps">ICE</span> installation while preserving your data and configuration settings.</p>

	<p><b>3. After installation, run the MySQL Upgrade utility from the Windows command line:</b></p>

	<p style="padding-left:2em;"><code>cd &quot;C:\Program Files\Infobright&quot;</code>  <br />
<code>.\bin\mysql_upgrade.exe --defaults-file=&quot;C:</code>&#92;Program Files&#92;Infobright&#92;my-ib.ini&#8221; <code>-uroot --tmpdir=c:\tmp</code></p>

	<p><b>Important:</b>    The MySQL Upgrade utility may display several errors regarding the use of locks with log tables and errors requiring table upgrades. The errors are all handled automatically by Infobright and/or the upgrade utility and can be ignored.</p>

	<p>4. Stop and start the Infobright server from the Start Menu items.</p>]]></description>
      <dc:subject>Upgrade Guide for Windows</dc:subject>
      <dc:date>2010-03-17T15:22:01+00:00</dc:date>
    </item>

    <item>
      <title>Upgrade Guide</title>
      <link>http://www.infobright.org/wiki/Upgrade_Guide/</link>
      <guid>http://www.infobright.org/wiki/Upgrade_Guide/</guid>
      <description><![CDATA[	<p><b>Note:</b> These instructions are for upgrading on Linux platforms using the <span class="caps">RPM</span> or <span class="caps">DEB</span> packages. <i>If the previous installation was done using the tarball package, you must upgrade using the tarball package</i> (<a href="http://www.infobright.org/wiki/Tar_Upgrade_Guide/">See Tar Upgrade Instructions</a>). Upgrading from a tar package to an <span class="caps">RPM</span> or <span class="caps">DEB</span> package will be supported in an upcoming release.</p>

	<p><b>Note:</b> Due to the port to MySQL 5.1 GA, the underlying data structures have changed. Please see step 4 below on how to run the MySQL Updater to migrate your previous database to 3.1.1 during the upgrade. After upgrading to 3.1.1 you will not be able to use a 3.1.1 database with a previous versions of <span class="caps">ICE</span>. We recommend you backup your data before upgrading in case you wish to downgrade for any reason.</p>

	<p>For upgrading on Windows XP, please see <a href="http://www.infobright.org/wiki/Upgrade_Guide_for_Windows/" title="Upgrade_Guide_for_Windows">Upgrade Guide for Windows</a>.</p>

	<p>To upgrade Infobright on Linux using the rpm or deb package: </p>

	<p>1. Obtain root user access</p>

	<p>2. Run either: </p>

	<p style="padding-left:2em;"><code>rpm -U infobright-version-platform.rpm</code><br />
<code>dpkg -i infobright-version-platform.deb</code></p>

	<p>3. Start the <span class="caps">ICE</span> server:</p>

	<p style="padding-left:2em;"><code>/etc/init.d/mysqld-ib start</code></p>

	<p><b>4. Run mysql upgrade tool to upgrade data folder:</b></p>

	<p style="padding-left:2em;"><code>cd /usr/local/inforbright</code><br />
<code>./bin/mysql_upgrade --defaults-file=/etc/my-ib.cnf --user=root --tmpdir=/tmp</code></p>

	<p><b>Important:</b> The MySQL Upgrade utility may display several errors regarding the use of locks with log tables and errors requiring table upgrades. The errors are all handled automatically by Infobright and/or the upgrade utility and can be ignored.</p>

	<p>5. Re-start the Infobright server:</p>

	<p style="padding-left:2em;"><code>/etc/init.d/mysqld-ib restart</code></p>

	<p>6. Confirm the build version as IB_3.3.1_r6997_7017:</p>

	<p style="padding-left:2em;"><code>/usr/local/infobright/bin/mysqld --version</code></p>]]></description>
      <dc:subject>Upgrade Guide</dc:subject>
      <dc:date>2010-01-29T15:53:19+00:00</dc:date>
    </item>

    <item>
      <title>Install Guide</title>
      <link>http://www.infobright.org/wiki/Install_Guide/</link>
      <guid>http://www.infobright.org/wiki/Install_Guide/</guid>
      <description><![CDATA[	<p><b>Tar Package Installation Instructions</b></p>

	<p>1. <a href="http://www.infobright.org/Downloads/ICE/">Download the install package</a> (e.g. infobright-3.3-x86_64-ice.tar.gz) to the server where you are installing Infobright</p>

	<p>2. Obtain root user access</p>

	<p>3. Change to the parent location in which you want to install (e.g. /usr/local) </p>

	<p style="padding-left:2em;"><code>cd /usr/local</code></p>

	<p><b>Note:</b> Please do not install in the root or home directories due to possible MySQL permission checking issues during install, start up, and/or load.</p>

	<p>4. Unpack the tarball, which will create the product directory (infobright-3.3-x86_64-ice/), and create a symbolic link &#8216;infobright&#8217; to the product folder</p>

	<p style="padding-left:2em;"><code>gunzip</code> &lt; <code>/path/to/infobright-3.3-x86_64-ice.tar.gz | tar xvf -</code><br />
<code>ln -s /usr/local/infobright-3.3-x86_64-ice infobright</code><br />
<code>cd /usr/local/infobright</code></p>

	<p>5. Run the install script with the <code>&quot;--help</code>&#8221; flag to check for system configuration and provide examples of directory parameters</p>

	<p style="padding-left:2em;"><code>./install-infobright.sh --help</code></p>

	<p style="padding-left:2em;"><code>Parameters required-</code><br />
<code>--datadir=infobright data folder  [‑‑datadir=/usr/local/infobright/data]</code><br />
<code>--cachedir=infobright cache folder  [‑‑cachedir=/usr/local/infobright/cache]</code><br />
<code>--config=mysql conf file to be created  [--config=/etc/my-ib.cnf]</code><br />
<code>--port=infobright server port  [--port=3306]</code><br />
<code>--socket=socket file to be used by this server  [‑‑socket=/tmp/mysql-ib.sock]</code><br />
<code>--user=user to be created if not exist  [--user=mysql]</code><br />
<code>--group=user group be created if not exist  [--group=mysql]</code></p>

	<p style="padding-left:2em;"><code>Example command</code><br />
<code>./install-infobright.sh          (install with defaults)</code><br />
<code>./install-infobright.sh --help</code><br />
<code>./install-infobright.sh --force  (bypass system compatibility checking)</code><br />
<code>./install-infobright.sh --datadir=/usr/local/infobright/data --cachedir=/usr/local/infobright/cache --port=3306 --config=/etc/my-ib.cnf --socket=/tmp/mysql-ib.sock --user=mysql --group=mysql --force</code></p>

	<p>6. Run the install script again, this time with directory parameters. If parameters are used that already exist, an error will occur (for example running the same script with parameters twice)</p>

	<p><a href="http://www.infobright.org/wiki/Install_Guide_Part_2/" title="Install_Guide_Part_2">Install Guide Part 2</a></p>]]></description>
      <dc:subject>Install Guide</dc:subject>
      <dc:date>2009-12-15T13:18:37+00:00</dc:date>
    </item>

    <item>
      <title>Install Guide for Windows</title>
      <link>http://www.infobright.org/wiki/Install_Guide_for_Windows/</link>
      <guid>http://www.infobright.org/wiki/Install_Guide_for_Windows/</guid>
      <description><![CDATA[	<p><b>Note:</b> These instructions are for installing <span class="caps">ICE</span> 3.x on Windows XP. For Linux operating systems, please see <a href="http://www.infobright.org/wiki/Install_Guide_for_Linux/" title="Install_Guide_for_Linux">Install Guide for Linux</a>.</p>

	<p><b>Installation Instructions</b></p>

	<p>1. <a href="http://www.infobright.org/Download/ICE/">Download the install package</a> infobright-3.3-win32.zip to the Windows XP machine on which you are installing Infobright</p>

	<p>2. Double click the infobright-3.3-win32.zip file to unzip the install.exe file</p>

	<p>3. Double click on the infobright-3.3-win32.exe file to launch the Install Wizard. Click <b>Next</b> to continue</p>

	<p>4. Click <b>I Agree</b> to accept the <span class="caps">GPL</span> license agreement</p>

	<p>5. By default <span class="caps">ICE</span> is installed in C:\Program Files\Infobright. To change the default location, either enter the folder name in the field or click Browse… to select desired install location on your compute. Click <b>Install</b> to accept the install location</p>

	<p>6. After the Install Wizard completes the installation, choose if you want <span class="caps">ICE</span> to start on completion of the installation. Click <b>Finish</b> to complete the installation</p>

	<p>7. To connect to the <span class="caps">ICE</span> command line interface, run:</p>

	<p style="padding-left:2em;"><code>Start/All Programs/Infobright/Infobright Command Line Client</code></p>

	<p>8. To uninstall <span class="caps">ICE</span>, select “Infobright Uninstall” under the Infobright program group in the Windows Start Menu:</p>

	<p style="padding-left:2em;"><code>Start/All Programs/Infobright/Infobright Uninstall</code></p>

	<p><b>Configuration Settings</b></p>

	<p>The install determines optimum memory settings based on the physical memory of the system. The settings assume that there are no other services on the machine consuming significant memory. If this is not the case, please lower the memory settings by editing the file brighthouse.ini within the data directory.</p>

	<p>The Install Wizard automatically creates <span class="caps">ICE</span> as a Windows Service, which allows the Infobright server to be started and stopped automatically when you boot or shutdown Windows. If you do not want <span class="caps">ICE</span> to start on boot, open the Services window from the Control Panel and change the Startup Type for Infobright from “Automatic” to “Manual.”</p>

	<p>To manually start the Infobright server, from the Windows Start Menu run:</p>

	<p style="padding-left:2em;"><code>Start/All Programs/Infobright/Infobright Start</code></p>

	<p>To manually stop the Infobright server, from the Windows Start Menu run:</p>

	<p style="padding-left:2em;"><code>Start/All Programs/Infobright/Infobright Stop</code></p>]]></description>
      <dc:subject>Install Guide for Windows</dc:subject>
      <dc:date>2009-12-15T13:17:49+00:00</dc:date>
    </item>

    <item>
      <title>Install Guide for Linux</title>
      <link>http://www.infobright.org/wiki/Install_Guide_for_Linux/</link>
      <guid>http://www.infobright.org/wiki/Install_Guide_for_Linux/</guid>
      <description><![CDATA[	<p><b>Note:</b> These instructions are for installing <span class="caps">ICE</span> 3.x on Linux operating systems using the <span class="caps">RPM</span> or <span class="caps">DEB</span> packages. To install using the tarball, please see the tar <a href="http://www.infobright.org/wiki/Install_Guide/" title="Install_Guide">Install Guide</a>. For Windows XP, please see <a href="http://www.infobright.org/wiki/Install_Guide_for_Windows/" title="Install_Guide_for_Windows">Install Guide for Windows</a>.</p>

	<p><b>Installation Instructions</b></p>

	<p>1. <a href="http://www.infobright.org/Downloads/ICE/">Download the install package</a> (e.g. infobright-3.3-x86_64.rpm) to the server where you are installing Infobright</p>

	<p>2. Obtain root user access</p>

	<p>3. To install the <span class="caps">RPM</span> package, run:</p>

	<p style="padding-left:2em;"><code>rpm -i infobright_version_name.rpm [optional: --prefix=path]</code></p>

	<p>To install the <span class="caps">DEB</span> package, run:</p>

	<p style="padding-left:2em;"><code>dpkg -i infobright_version_name.deb</code></p>

	<p><b>Note:</b> Please do not install <span class="caps">ICE</span> in the root or home directories due to possible MySQL permission checking issues during install, start up, and/or load.</p>

	<p>4. To change the default install options, after installation run:</p>

	<p style="padding-left:2em;"><code>/usr/local/infobright/postconfig.sh</code></p>

	<p>You can run this script at any time after installation to change the datadir, CacheFolder, socket, and port. The script must be run as root and <span class="caps">ICE</span> must not be running.</p>

	<p>5. The installation determines the optimum memory settings based on the physical memory of the system. You may change these settings by editing the file brighthouse.ini within the data directory. </p>

	<p><b>Important:</b> The memory settings assume that there are no other services on the machine consuming significant memory. If this is not the case, please lower the memory settings for Infobright.</p>

	<p>6. To start or stop <span class="caps">ICE</span>, run:</p>

	<p style="padding-left:2em;"><code>/etc/init.d/mysqld-ib start</code><br />
<code>/etc/init.d/mysqld-ib stop</code></p>

	<p>7.  To connect to <span class="caps">ICE</span>, use the script mysql-ib: </p>

	<p style="padding-left:2em;"><code>/usr/bin/mysql-ib [optional:db_name]</code></p>

	<p>8. To uninstall <span class="caps">ICE</span>, run either:</p>

	<p style="padding-left:2em;"><code>rpm -e infobright</code><br />
<code>dpkg -r infobright</code></p>]]></description>
      <dc:subject>Install Guide for Linux</dc:subject>
      <dc:date>2009-12-15T13:17:33+00:00</dc:date>
    </item>

    <item>
      <title>Query Execution Log</title>
      <link>http://www.infobright.org/wiki/Query_Execution_Log/</link>
      <guid>http://www.infobright.org/wiki/Query_Execution_Log/</guid>
      <description><![CDATA[	<p>Infobright currently does not support the MySQL <span class="caps">EXPLAIN</span> command. As a columnar database, the Infobright engine generates an execution plan which is not easily convertible to MySQL-like <span class="caps">EXPLAIN</span> notions. Moreover, the actual execution plan is generated dynamically, based on Knowledge Nodes and previous execution steps, thus it is not possible to generate it without the actual execution of a query.</p>

	<p>Instead, the Query Execution Log is used to track the execution plan, provide rough statistics, and provide insights into performance bottlenecks.</p>

	<p><b>Maintaining the Query Execution Log</b></p>

	<p>The query execution log is located:</p>

	<ul>
		<li> in <i>bh.err</i> file in your database directory (configurable as log-error value in the <code>--</code>config file provided at installation, /etc/my-ib.cnf by default),</li>
		<li>on console, if the server is run with <code>--</code>console option</li>
	</ul>

	<p>By default, the Query Execution Log contains information on server start and shutdown, as well as values of execution parameters (from the <i>brighthouse.ini</i> file). To enable more detailed query execution logging, follow these steps:</p>

	<p>1. Open the <i>brighthouse.ini</i> configuration file, located in your database directory</p>

	<p>2. Set the following option:</p>

	<p style="padding-left:2em;"><code>ControlMessages = 2</code></p>

	<p>3. Restart the Infobright server to execute the change</p>

	<p>The execution log for a query may be quite large (several KBs), and the <i>bh.err</i> log may grow substantially. For a server executing a lot of small queries it is recommended either to switch the logging off (ControlMessages = 0), or to implement an automatic backup scheme. A shell script (Unix) which copies the error log to a backup file and re-initializes the bh.err file is available <a href="http://www.infobright.org/Downloads/Contributed-Software/">here</a></p>

	<p>Set ControlMessages = 1 to obtain a log in more compact form (without timestamps).</p>

	<p><b>Understanding Query Execution Log</b></p>

	<p>Most of the lines of the log consists of a timestamp, and a session number in a square bracket. The session number is maintained by a querying tool &#8211; some tools use different numbers for each subsequent query, some other will keep the number for the next queries. The number in the log is useful to determine which message is generated by which query (running in parallel). For example:</p>

	<p style="padding-left:2em;"><code>2009-05-11 14:30:10 [6] (t0): 25 all packrows, 25 to open (including 25 full)</code><br />
<code>2009-05-11 14:30:11 [2] Displaying result: 1000 rows.</code></p>

	<p>These two log messages are connected to two different queries (session 6 and 2) and should not be understood as a sequence of events.</p>

	<p>When a query starts, its compiled version is displayed in the log, as a sequence of internal Infobright execution steps:</p>

	<p style="padding-left:2em;"><code>2009-05-12 09:29:26 [1] T:-1 = TABLE_ALIAS(T:0)</code><br />
<code>T:-2 = TMP_TABLE(T:-1)</code><br />
<code>A:-1 = T:-2.ADD_COLUMN(TERM(t:-1 a:0),LIST,&quot;RECORDTYPE&quot;,&quot;ALL&quot;)</code><br />
<code>... </code></p>

	<p>The query is then executed by the Infobright optimizer, and each step is described in the log. Before the exact calculation, a result of rough execution is presented, including a total number of data packs, and data packs excluded by KNs. The log for a query is completed after displaying the summary of loaded and decompressed (i.e. not present in cache) data packs:</p>

	<p style="padding-left:2em;"><code>2009-05-12 09:29:26 [1] Displaying result: 20 rows.</code><br />
<code>2009-05-12 09:29:26 [1] Total data packs actually loaded (approx.): 35</code><br />
<code>2009-05-12 09:29:26 [1] ---------------------------------------------------------------------------- </code></p>

	<p>The query log is a useful tool for identifying bottlenecks and pinpointing errors. The following messages may indicate problems:</p>

	<p style="padding-left:2em;"><code>Table ./mydb/clients (41) accessed by MySQL engine.</code></p>

	<p>The Infobright table was accessed by MySQL engine, instead of Infobright one. Possible reasons:</p>

	<ul>
		<li>Unsupported syntax is used.</li>
		<li>Join with non-Infobright table is performed.</li>
		<li>MySQL format is used in export, instead of Infobright text format.</li>
		<li>MySQL is gathering statistics of Infobright tables either for <span class="caps">ETL</span> tool, or to optimize query (e.g. outer joins) before sending it back to Infobright engine.</li>
	</ul>

	<p>All cases except the last one mean that the query will be very slow.</p>

	<p style="padding-left:2em;"><code>2009-05-29 07:41:35 [7] Warning: a big intermediate object created (~268 GB)</code></p>

	<p>This message means that a substantial disk space will be used to execute the query. In most cases it is not intended and may indicate a mistake in query formulation &#8211; e.g. a full Cartesian join of tables with millions of rows.</p>

	<p style="padding-left:2em;"><code>2009-11-06 18:52:20 [1] Starting joiner loop (4017000000000 rows).</code></p>

	<p><b>Joiner loop</b> is the least efficient joining algorithm in Infobright (just a quadratic loop through all pairs of rows). The number in message indicates the number of pairs to be checked. If this number is large (as above), it is probably better to stop query and rethink its formulation, to avoid joins declared in implicit way, e.g.:</p>

	<p style="padding-left:2em;"><code>...WHERE t1.x + t2.y </code>&gt; <code>5... </code>&gt; <code>...WHERE t1.x </code>&gt; <code>5 - t2.y...</code></p>

	<p>The latter formulation will use much faster joining algorithm.</p>

	<p>For some long-lasting operations it is possible to forecast approximate total time basing on log:</p>

	<p style="padding-left:2em;"><code>2009-11-06 19:05:57 [1] Aggregating: 1000000000 tuples left, 0 gr. found so far</code><br />
<code>2009-11-06 19:17:59 [1] Aggregating: 864292787 tuples left, 3677031 gr. found so far</code></p>

	<p>Using timestamps we can conclude that 722 sec. was spent on 136 mln. rows (13.6%), which means that the query will probably run for another 1 h 16 minutes.</p>]]></description>
      <dc:subject>Query Execution Log</dc:subject>
      <dc:date>2009-11-20T18:25:36+00:00</dc:date>
    </item>

    <item>
      <title>Tips &amp; Tricks</title>
      <link>http://www.infobright.org/wiki/Tips_%26_Tricks/</link>
      <guid>http://www.infobright.org/wiki/Tips_%26_Tricks/</guid>
      <description><![CDATA[	<p>While the standard parameter settings are documented in the Install Guide, performance can be tuned based on:</p>

	<ul>
		<li>Hardware resources (available <span class="caps">RAM</span>, number of cores, etc.)</li>
		<li>Operating system &#40;Red Hat Enterprise Linux, Ubuntu, CentOS, etc.&#41;</li>
	</ul>

	<p>Based on the user’s environment, the following Tip &amp; Tricks pages discuss which parameters can be tweaked and provides guidelines for appropriate parameters values:  </p>

	<ul>
		<li><a href="http://www.infobright.org/wiki/Optimizing_Queries/" title="Optimizing_Queries">Optimizing Queries</a></li>
		<li><a href="http://www.infobright.org/wiki/How_and_When_to_use_Lookups/" title="How_and_When_to_use_Lookups">How and When to use Lookups</a></li>
		<li><a href="http://www.infobright.org/wiki/Supported_Data_Types_and_Values/" title="Supported_Data_Types_and_Values">Supported Data Types and Values</a></li>
		<li><a href="http://www.infobright.org/wiki/Efficient_Data_Types/" title="Efficient_Data_Types">Efficient Data Types</a></li>
		<li><a href="http://www.infobright.org/wiki/Optimized_SQL_Functions_and_Operators/" title="Optimized_SQL_Functions_and_Operators">Optimized <span class="caps">SQL</span> Functions and Operators</a></li>
		<li><a href="http://www.infobright.org/wiki/Knowledge_Grid_Statistics/" title="Knowledge_Grid_Statistics">Knowledge Grid Statistics</a></li>
		<li><a href="http://www.infobright.org/wiki/Query_Execution_Log/" title="Query_Execution_Log">Query Execution Log</a></li>
		<li><a href="http://www.infobright.org/wiki/Linux_Tuning/" title="Linux_Tuning">Linux Tuning</a></li>
	</ul>]]></description>
      <dc:subject>Tips &amp; Tricks</dc:subject>
      <dc:date>2009-11-18T21:11:11+00:00</dc:date>
    </item>

    <item>
      <title>Efficient Data Types</title>
      <link>http://www.infobright.org/wiki/Efficient_Data_Types/</link>
      <guid>http://www.infobright.org/wiki/Efficient_Data_Types/</guid>
      <description><![CDATA[	<p>The following data types are identified as being more efficient within Infobright:</p>

	<p>Columns stored as integers are much more efficient (easier to sort, better described by Knowledge Nodes, etc.) than other data types. So if possible, store data as any of the following:</p>

	<p style="padding-left:2em;"><code>TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT</code><br />
<code>DECIMAL</code> &#8212; note: storing as (10,0) will be much faster than (10,5)<br />
<code>DATE, TIME</code></p>

	<p>Special case data types:</p>

	<p style="padding-left:2em;"><code>CHAR, VARCHAR</code> &#8212; these types are covered in the Knowledge Grid, but where possible should be replaced numeric values, as they are better optimized and faster to decompress</p>

	<p>Less optimized data types:</p>

	<p style="padding-left:2em;"><code>BINARY, VARBINARY</code><br />
<code>FLOAT</code><br />
<code> DOUBLE</code><br />
<code>TINYTEXT, TEXT</code></p>

	<p><acronym title="n, 0"><span class="caps">DECIMAL</span></acronym> is a different, relatively less efficient <span class="caps">PHYSICAL</span> representation of <span class="caps">INTEGER</span>. <acronym title="precision, scale"><span class="caps">DECIMAL</span></acronym> is much more efficient than <span class="caps">FLOAT</span> or <span class="caps">DOUBLE</span> and therefore, should be used in place of <span class="caps">FLOAT</span> or <span class="caps">DOUBLE</span> if possible.</p>]]></description>
      <dc:subject>Efficient Data Types</dc:subject>
      <dc:date>2009-11-06T19:38:24+00:00</dc:date>
    </item>

    <item>
      <title>Optimizing Queries</title>
      <link>http://www.infobright.org/wiki/Optimizing_Queries/</link>
      <guid>http://www.infobright.org/wiki/Optimizing_Queries/</guid>
      <description><![CDATA[	<p>These suggestions are written for a technical audience and covers in detail what types of database queries are optimized for <span class="caps">ICE</span>.</p>

	<p><span class="caps">ICE</span> is a data storage engine with proprietary compression, storage, and retrieval methods. It leverages many features of MySQL including a support for variety widely-used <span class="caps">API</span>s (e.g. <span class="caps">SQL</span>, <span class="caps">ODBC</span>, <span class="caps">JDBC</span>). </p>

	<p>There are specific <span class="caps">SQL</span> commands that have been optimized for Infobright, meaning they use the Knowledge Grid to resolve queries. For other MySQL functions, Infobright will resolve them by defaulting to the MySQL optimizer in order to resolve the query. This can be considerably slower as the MySQL optimizer is row-oriented, is not able to use the Knowledge Grid and must decompress significantly more data. In these cases the query will return with a warning. Use <span class="caps">SHOW</span> <span class="caps">WARNINGS</span>; to see the message:</p>

	<p style="padding-left:2em;"><code>Query syntax not implemented in Infobright, executed by MySQL engine.</code></p>

	<p>There are several things that can be done to optimize queries within Infobright:</p>

	<p><b>Use <a href="http://www.infobright.org/wiki/Optimized_SQL_Functions_and_Operators/" title="Optimized_SQL_Functions_and_Operators">Optimized <span class="caps">SQL</span> Functions and Operators</a></b></p>

	<p><b>Use More <a href="http://www.infobright.org/wiki/Efficient_Data_Types/" title="Efficient_Data_Types">Efficient Data Types</a></b></p>

	<p><b>OR Function</b><br />
The OR consistently has poorer performance because it essentially creates two separate intermediate structures and then gathers results together, omitting repetitions. The latter operation is very time-consuming. If possible, OR functions should be replaced by IN or <span class="caps">UNION</span> <span class="caps">ALL</span> (if there are no repetitions possible):</p>

	<p>Example:</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">SELECT&nbsp;…&nbsp;WHERE&nbsp;a</span><span style="color: #007700">=</span><span style="color: #0000BB">5&nbsp;</span><span style="color: #007700">OR&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">=</span><span style="color: #0000BB">10&nbsp;</span><span style="color: #007700">---&gt;;&nbsp;</span><span style="color: #0000BB">SELECT&nbsp;…&nbsp;WHERE&nbsp;a&nbsp;IN&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">5</span><span style="color: #007700">,</span><span style="color: #0000BB">10</span><span style="color: #007700">)<br /></span><span style="color: #0000BB">SELECT&nbsp;…&nbsp;WHERE&nbsp;a</span><span style="color: #007700">=</span><span style="color: #0000BB">5&nbsp;</span><span style="color: #007700">OR&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">10&nbsp;</span><span style="color: #007700">---&gt;;&nbsp;(</span><span style="color: #0000BB">SELECT&nbsp;…&nbsp;WHERE&nbsp;a</span><span style="color: #007700">=</span><span style="color: #0000BB">5</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">UNION&nbsp;ALL&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">SELECT&nbsp;…&nbsp;WHERE</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">pre</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">10</span><span style="color: #007700">)&nbsp;</span>
</span>
</code></div>

	<p><b><span class="caps">UNION</span> Function</b><br />
<span class="caps">UNION</span> is slower than <span class="caps">UNION</span> <span class="caps">ALL</span> because it must detect and omit repetitions in the result (for a very large output, it uses operations like sorting etc.). If repetitions are not harmful, or if it is already known that the result does not contain repetitions, <span class="caps">UNION</span> <span class="caps">ALL</span> should be used.</p>

	<p><b>Leveraging Columnar Architecture</b></p>

	<p>Infobright is a columnar database, which means that access to every column of data is independent. As a consequence, it is important how many fields of one row of data are being accessed. For optimal performance, you should avoid accessing columns that not being used in the query results. Instead of <span class="caps">SELECT</span> * <span class="caps">FROM</span>&#8230; you should rather select only the necessary columns.</p>

	<p><b>Limiting Tables Used in Results</b></p>

	<p>The Infobright engine may optimize join execution if there is a possibility that one of the involved tables is not used in further phases of execution, like <span class="caps">SELECT</span> list, <span class="caps">GROUP</span> BY, <span class="caps">ORDER</span> BY. E.g., assuming t2 is a large fact table:</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">SELECT&nbsp;t1</span><span style="color: #007700">.</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sum</span><span style="color: #007700">(</span><span style="color: #0000BB">t2</span><span style="color: #007700">.</span><span style="color: #0000BB">b</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">FROM&nbsp;t1&nbsp;JOIN&nbsp;t2&nbsp;ON&nbsp;t1</span><span style="color: #007700">.</span><span style="color: #0000BB">key</span><span style="color: #007700">=</span><span style="color: #0000BB">t2</span><span style="color: #007700">.</span><span style="color: #0000BB">key<br />WHERE&nbsp;t1</span><span style="color: #007700">.</span><span style="color: #0000BB">x&nbsp;</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">0&nbsp;</span><span style="color: #007700">AND&nbsp;</span><span style="color: #0000BB">t2</span><span style="color: #007700">.</span><span style="color: #0000BB">y&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">5<br />GROUP&nbsp;BY&nbsp;t1</span><span style="color: #007700">.</span><span style="color: #0000BB">a</span><span style="color: #007700">;&nbsp;</span>
</span>
</code></div>

	<p>This query may be sometimes transformed into:</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">SELECT&nbsp;t1copy</span><span style="color: #007700">.</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sum</span><span style="color: #007700">(</span><span style="color: #0000BB">temp_tab</span><span style="color: #007700">.</span><span style="color: #0000BB">sum2</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">FROM<br />&nbsp;&nbsp;</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">SELECT&nbsp;t2</span><span style="color: #007700">.</span><span style="color: #0000BB">key&nbsp;</span><span style="color: #007700">AS&nbsp;</span><span style="color: #0000BB">k2</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sum</span><span style="color: #007700">(</span><span style="color: #0000BB">t2</span><span style="color: #007700">.</span><span style="color: #0000BB">b</span><span style="color: #007700">)&nbsp;AS&nbsp;</span><span style="color: #0000BB">sum2&nbsp;FROM&nbsp;t1&nbsp;JOIN&nbsp;t2&nbsp;ON&nbsp;t1</span><span style="color: #007700">.</span><span style="color: #0000BB">key</span><span style="color: #007700">=</span><span style="color: #0000BB">t2</span><span style="color: #007700">.</span><span style="color: #0000BB">key<br />&nbsp;&nbsp;&nbsp;&nbsp;WHERE&nbsp;t1</span><span style="color: #007700">.</span><span style="color: #0000BB">x&nbsp;</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">0&nbsp;</span><span style="color: #007700">AND&nbsp;</span><span style="color: #0000BB">t2</span><span style="color: #007700">.</span><span style="color: #0000BB">y&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">5<br />&nbsp;&nbsp;&nbsp;&nbsp;GROUP&nbsp;BY&nbsp;t2</span><span style="color: #007700">.</span><span style="color: #0000BB">key&nbsp;</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">temp_tab</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">t1&nbsp;t1copy<br />WHERE&nbsp;temp_tab</span><span style="color: #007700">.</span><span style="color: #0000BB">k2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">t1copy</span><span style="color: #007700">.</span><span style="color: #0000BB">key<br />GROUP&nbsp;BY&nbsp;t1copy</span><span style="color: #007700">.</span><span style="color: #0000BB">a</span><span style="color: #007700">;&nbsp;</span>
</span>
</code></div>

	<p>In such cases the inner query produces the grouping, which is nearly what is needed, but it is defined in terms of t2 only. Then the grouping is refined by externally transforming it into grouping by t1. Sometimes such transformations may improve performance by an order of magnitude, but it works only for aggregations which may be combined from parts (like sum).</p>

	<p>A simpler example of transformation:</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">SELECT&nbsp;t1</span><span style="color: #007700">.</span><span style="color: #0000BB">a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">t2</span><span style="color: #007700">.</span><span style="color: #0000BB">val&nbsp;FROM&nbsp;t1&nbsp;JOIN&nbsp;t2&nbsp;ON&nbsp;t1</span><span style="color: #007700">.</span><span style="color: #0000BB">a</span><span style="color: #007700">=</span><span style="color: #0000BB">t2</span><span style="color: #007700">.</span><span style="color: #0000BB">b&nbsp;WHERE&nbsp;t1</span><span style="color: #007700">.</span><span style="color: #0000BB">c&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">5</span><span style="color: #007700">;&nbsp;</span>
</span>
</code></div>

	<p>and a faster equivalent (using only t2 on <span class="caps">SELECT</span> list):</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">SELECT&nbsp;t2</span><span style="color: #007700">.</span><span style="color: #0000BB">b</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">t2</span><span style="color: #007700">.</span><span style="color: #0000BB">val&nbsp;FROM&nbsp;t1&nbsp;JOIN&nbsp;t2&nbsp;ON&nbsp;t1</span><span style="color: #007700">.</span><span style="color: #0000BB">a</span><span style="color: #007700">=</span><span style="color: #0000BB">t2</span><span style="color: #007700">.</span><span style="color: #0000BB">b&nbsp;WHERE&nbsp;t1</span><span style="color: #007700">.</span><span style="color: #0000BB">c&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">5</span><span style="color: #007700">;&nbsp;</span>
</span>
</code></div>]]></description>
      <dc:subject>Optimizing Queries</dc:subject>
      <dc:date>2009-11-05T15:55:08+00:00</dc:date>
    </item>

    
    </channel>
</rss>