In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
1147 [In-Portal CMS] Database feature request N/A 2011-10-17 08:31 2012-07-25 05:32
alex  
alex  
normal  
closed 5.1.3  
fixed  
 
none 5.2.0-B1  
https://groups.google.com/d/topic/in-portal-dev/ktW1fmOoUTM/discussion
Adds methods for large data amounts (from database) processing
1
0001147: Methods for processing large data amounts from database
In-Portal nice $this->Application->Conn->Query method, that accepts SQL and returns an array of data to used right away. This proved very useful for small sets of data.

However, when you need to process 2000 or more records, then this method will eat up a lot of memory while transforming sql result into PHP array.

Attached methods contains kDBConnection::QueryRaw and kDBConnection::GetNextRow methods, that basically does the same what mysql_query and mysql_fetch_assoc methods. Also kDBConnection::Destroy method was changed to accept incoming recordset resource, that needs to be destroyed.


Here is usage example:

$rs = $this->Conn->QueryRaw($sql);

while ( $row = $this->Conn->GetNextRow($rs) ) {
    echo $row['userid'];
    echo $row['fullname'];
    echo $row['userstatus'];
}

$this->Conn->Destroy($rs);
patch db_class_for_large_data_set_512.patch (3,003) 2011-10-17 08:31
http://tracker.in-portal.org/file_download.php?file_id=1247&type=bug
patch db_class_for_large_data_set_513.patch (2,873) 2011-10-17 08:31
http://tracker.in-portal.org/file_download.php?file_id=1248&type=bug
patch db_class_for_large_data_set_520.patch (3,736) 2011-12-08 04:14
http://tracker.in-portal.org/file_download.php?file_id=1358&type=bug
Issue History
2012-07-25 05:32 alex Note Added: 0005031
2012-07-25 05:32 alex Status resolved => closed
2011-12-08 04:14 alex Note Added: 0004228
2011-12-08 04:14 alex Status reviewed and tested => resolved
2011-12-08 04:14 alex Fixed in Version => 5.2.0-B1
2011-12-08 04:14 alex Resolution open => fixed
2011-12-08 04:14 alex Changeset attached 5.2.x r14845
2011-12-08 04:14 alex File Added: db_class_for_large_data_set_520.patch
2011-12-07 18:07 Dmitry Note Added: 0004220
2011-12-07 18:07 Dmitry Assigned To !COMMUNITY => alex
2011-12-07 18:07 Dmitry Status needs testing => reviewed and tested
2011-10-22 05:27 alex Estimate Points => 1
2011-10-17 08:34 alex Assigned To => !COMMUNITY
2011-10-17 08:34 alex Developer => alex
2011-10-17 08:34 alex Status active => needs testing
2011-10-17 08:34 alex Reference => https://groups.google.com/d/topic/in-portal-dev/ktW1fmOoUTM/discussion
2011-10-17 08:31 alex File Added: db_class_for_large_data_set_513.patch
2011-10-17 08:31 alex New Issue
2011-10-17 08:31 alex File Added: db_class_for_large_data_set_512.patch
2011-10-17 08:31 alex Change Log Message => Adds methods for large data amounts (from database) processing

Notes
(0004220)
Dmitry   
2011-12-07 18:07   
Tested okay on 5.1.3. Please update and apply to 5.2.0 and commit.
(0004228)
alex   
2011-12-08 04:14   
Fix committed to 5.2.x branch. Commit Message:

Fixes 0001147: Methods for processing large data amounts from database
(0005031)
alex   
2012-07-25 05:32   
Since 5.2.0 version was released.