dsgsdg206050 2014-03-18 14:46
浏览 39
已采纳

使用PHP连接到Columnar数据库

SQL Server 2012 introduces a new index type called a column store index and new query operators that efficiently process batches of rows at a time. These two features together greatly improve the performance of typical data warehouse queries, in some cases by two orders of magnitude. This paper outlines the design of column store indexes and batch-mode processing and summarizes the key benefits this technology provides to customers. It also highlights some early customer experiences and feedback and briefly discusses future enhancements for column store indexes.

My Question is:

Is there any way to connect PHP-Mysql demo to that type of db?

There is lot of engines "MySql Based" as follows

  • InfiniDB
  • Infobright
  • MonetDB
  • ... etc

Is there any simple getting started with PHP-Mysql?

  • 写回答

2条回答 默认 最新

  • dongsheng4679 2014-03-19 14:43
    关注

    InfiniDB is a GPLv2 full open source MySQL wire compliant database. It uses the MySQL server as a frontend and the backend has been changed out and optimized for columnar storage. MyISAM and InnoDB tables are supported also, alongside the InfiniDB columnar tables. There is no limitations on the open source version and the enterprise support version. Use as many nodes and TB as you desire. If you are using MySQL now, you can drop in replace InfiniDB and should be able to connect through existing MySQL interfaces. Do recommend using the packaged cpimport utility of InfiniDB for loading data into the tables, it has been optimized for insertion into InfiniDB engine and is recommended to use instead of LOAD DATA.

    btw, I am an architect for InfiniDB, so here is my bias, free to try, use and scale :)

    Here is the example PHP from php.net running against my InfiniDB instance locally:

    I changed in my php.ini to point to the mysql.sock in the InfiniDB install (I am running the PHP on the same server as the DB)

    ; Default socket name for local MySQL connects.  If empty, uses the built-in
    ; MySQL defaults.
    ; http://www.php.net/manual/en/mysql.configuration.php#ini.mysql.default-socket
    mysql.default_socket = /usr/local/Calpont/mysql/lib/mysql/mysql.sock
    

    Using this phptest.php (basically the copy from php.net with my own db and tables)

    <?php
    // Connecting, selecting database
    $link = mysql_connect('localhost', 'root', '')
        or die('Could not connect: ' . mysql_error());
    echo 'Connected successfully';
    mysql_select_db('wide') or die('Could not select database');
    
    // Performing SQL query
    $query = 'SELECT count(*) FROM wide';
    $result = mysql_query($query) or die('Query failed: ' . mysql_error());
    
    // Printing results in HTML
    echo "<table>
    ";
    while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
        echo "\t<tr>
    ";
        foreach ($line as $col_value) {
            echo "\t\t<td>$col_value</td>
    ";
        }
        echo "\t</tr>
    ";
    }
    echo "</table>
    ";
    
    // Free resultset
    mysql_free_result($result);
    
    // Closing connection
    mysql_close($link);
    ?>
    

    Then running:

    [root@michael-vm2 tmp]# php phptest.php 
    Connected successfully<table>
        <tr>
            <td>100000</td>
        </tr>
    </table>
    

    This is all off a stock install of InfiniDB. Just change your create statement to specify the engine=infinidb and you are good to go.

    http://infinidb.co/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?