May 25, 2012

Post: Handling big result sets

….mysql-query.php. Unfortunately there is nothing interesting for our current task excluding link to mysql_unbuffered_query and this link says: mysql_unbuffered_query() sends a SQL query query to MySQL, without fetching and buffering the result rows automatically, as mysql_query() does. So mysql_query

Post: PHP Large result sets and summary tables.

… does not apply to MySQL result set. OK there is “easy” fix for this problem, you can use mysql_unbuffered_query instead and mysqli and PDO have their own way to reach similar behavior. This call users underlying mysql_use… to check if there are any errors while fetching. With mysql_unbuffered_query data comes in portions so you can well get an…

Comment: Handling big result sets

… the following results: mysql_query: Number of rows: 1000000. execution time: 24.53382897377 s mysql_unbuffered_query: (same code, only changing mysql_query to mysql_unbuffered_query) Number of rows… my table (InnoDB) has 10+ million records in there. The query I used: SELECT * FROM `current` LIMIT 1000000; I had to…