June 18, 2013

Post: PHP Large result sets and summary tables.

… can’t use mysql_num_rows() and mysql_data_seek() if you use this method but this is told in PHP manual and so… query the only real call you can get errors is when you run mysql_query , mysql_fetch_row simply reads data from memory and… while fetching. With mysql_unbuffered_query data comes in portions so you can well get an error while fetching rows. If you do…

Post: Wishes for new "Pure PHP" MySQL driver

If you’re following MySQL or PHP landscape you should have seen announcement by MySQL to develop pure PHP driver. If not – Here is… be able to get a table below page output listing all the queries, their exec times and number of rows they are… like to be able to run multiple queries for multiple MySQL connections at once. For scale out applications data to generate…

Post: Flexviews - part 3 - improving query performance using materialized views

… by customer_id, customer_name, sale_when; $ php convert.php demo < sales.sql CALL flexviews.create('demo', 'dashboard... the view. mysql> select flexviews.get_sql( -> flexviews.get_id(‘demo’,'dashboard_customer_sales’)) -> as ‘SQL’ \G *************************** 1. row *************************** SQL:…

Post: Using Flexviews - part two, change data capture

… is written in PHP so it is portable. Setting up FlexCDC FlexCDC has some basic requirements: MySQL 5.1+ row based logging (binlog…_updates=1, if this is a MySQL slave transaction_isolation=READ-COMMITTED You can get FlexCDC directly out of the Flexviews SVN… a table, insert some rows, add a change log, delete rows and then insert some more of them: mysql> create table > test.demo…

Post: PHP Sessions - Files vs Database Based

…on database level. If you change to store PHP sessions in MySQL instead this effect may be no more true…length. On the end of the session the same row is updated and transaction is committed. If you …use transactional tables for session you can use GET_LOCK to get same behavior. In the start of the …

Post: Shard-Query EC2 images available

mysql> show table status like ‘ontime_fact’G *************************** 1. row *************************** Name: ontime_fact Engine: InnoDB Version: 10 Row_format: Compact Rows: 6697533 Avg_row… your number of nodes) php genconfig 20 > shards.ini… throughput over response time, get a good plan …

Post: Shard-Query turbo charges Infobright community edition (ICE)

mysql> select count(*), count(distinct UniqueCarrier) from dim_flightG *************************** 1. row *************************** count(*): 58625 count(distinct UniqueCarrier): 29 1 row…Query includes a loader (loader.php) which can be used … the bug tracker. You can get Shard-Query (currently in …

Post: When EXPLAIN estimates can go wrong!

… of rows reported by MySQL in the output of EXPLAIN. Now this can be a real pain as MySQL uses “the number of rows… in MySQL 5.1 and how it calculates the row estimates. This bug was tracked down to http://bugs.mysql.com/bug.php?id…, but peek a few (10) of the intermediate pages to get a better estimate of the average number of records per…

Post: Accessing Percona XtraDB Cluster nodes in parallel from PHP using MySQL asynchronous queries

… asynchronous call to send a query to MySQL using a new MySQLnd driver for PHP. In this post I’ll only show… to MySQL, and we do not wait for result but rather get response later. The MySQLnd driver has been available since PHP 5…=>$link) { if ($result = $link->reap_async_query()) { $res = $result->fetch_row(); # Handle returned result mysqli_free_result($result); } else die(sprintf…